Video
This VBA code allows you to get this of all sheets name in current workbook by creating new worksheet.
You can use the code in Excel for mac & windows
- Copy the below VBA Code by clicking on the copy box
- Open Microsoft Visual Basic for Applications window Developer Ribbon Tab > Visual Basic (Shortcut keys as follows for mac & windows)
- mac users fn + ⌥ [option] + F11
- windows users Alt + F11
- From the menu bar select Insert > Module and insert new Module
- Paste the code into the module
x
18
18
1
'Coded By Faraz Shaikh
2
'Visit : www.ExcelExciting.com
3
Sub GetSheetNames()
4
5
Dim ws As Worksheet
6
Dim i As Integer
7
8
Sheets.Add
9
ActiveSheet.Name = "SheetNames"
10
ActiveSheet.Move Before:=ActiveWorkbook.Sheets(1)
11
'Visit : www.ExcelExciting.com
12
i = 1
13
For Each ws In Worksheets
14
ActiveSheet.Cells(i, 1) = ws.Name
15
i = i + 1
16
Next ws
17
'Visit : www.ExcelExciting.com
18
End Sub
Once the code is pasted into the module, close the VBA editor and goto
- Developer Tab > Macros
- List of all Macros will appear
- Select the macro “GetSheetNames”
- Click the run button to execute the code.

Was the information helpful in this blog?
- If yes, hit that share button and show the excitement to the world.
- Subscribe to our free posts.
Join 2,922 other subscribers
- If no, please let us know what to improve.