In this video, we take a look at how to generate a list of sheet names in an Excel workbook with and without VBA.
VBA method code:
Sub ListAllSheets()
Dim ws As Worksheet
Dim Counter As Integer
Counter = 0
For Each ws In ActiveWorkbook.Worksheets
ActiveCell.Offset(Counter, 0).Value = ws.Name
Counter = Counter + 1
Next ws
End Sub
XML Macro 4 method formula:
=REPLACE(GET.WORKBOOK(1),1,FIND("]",GET.WORKBOOK(1)),"") 👇
Check out my full courses and ebooks here
👉 https://www.howtoexcel.org/courses/
DOWNLOAD the example workbook here
📖 https://www.howtoexcel.org/downloads/
SUBSCRIBE & get my 3 FREE eBooks
📧 https://www.howtoexcel.org/newsletter/
CONNECT with me on social
Facebook: / howtoexcelblog
Twitter: / howtoexcelblog
LinkedIn: / john-macdougall
Thanks for all your support!