Wednesday, 28 March 2018

How to get a list of all the sheets in an Excel file in Excel VBA Macros | VBA code to get list of sheet names


How to get a list of all the sheets in an Excel file in Excel VBA Macros | VBA code to get list of sheet names :

Sub GetsheetNames()
Dim sht As Worksheet
'for backup
For Each sht In ActiveWorkbook.Sheets
    Selection.Value = sht.Name
    Selection.Offset(1, 0).Select
Next sht

End Sub