How do I display list of tab names used in a workbook on a sheet

G

Guest

I have a Workbook with 60 named tabs (ie not just Sheet 1, Sheet 2, ...) and
want to have the names appear on a list on a new tab called "Tab Name".
 
G

Guest

Consider this tiny macro:

Sub Macro1()
Dim w As Worksheet
i = 1
For Each w In Worksheets
Worksheets("Sheet1").Cells(i, 1) = w.Name
i = i + 1
Next
End Sub

It assumes that the worksheet "Sheet1" exists to do the recording.

Have a good day!
 
G

Gord Dibben

Sub ShowNames()
Set wkbkToCount = ActiveWorkbook
iRow = 1
With Sheets.Add
.Name = "Tab Name"
For Each ws In wkbkToCount.Worksheets
.Rows(iRow).Cells(1).Value = ws.Name
iRow = iRow + 1
Next
End With
End Sub


Gord Dibben Excel MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top