Can one print a list of worksheet tab labels contained in a workb.

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Is it possible to print a list of the tab labels contained within an Excel
workbook. If so, how?
 
You can list the worksheet names in a new sheet and then
print the list from there:

Sub ListWSNames()
Dim sh As Worksheet
Dim i As Long

With ActiveWorkbook
.Worksheets(1).Select
Set sh = .Worksheets.Add
End With

With sh
For i = 2 To ActiveWorkbook.Worksheets.Count
.Cells(i, "A").Value = Worksheets(i).Name
Next i
.Cells(1, "A").Value = "Sheet " & _
"Names (excl. this one)"
End With

Range("A:A").EntireColumn.AutoFit

End Sub
 

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

Back
Top