ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Can one print a list of worksheet tab labels contained in a workb. (https://www.excelbanter.com/excel-discussion-misc-queries/10231-can-one-print-list-worksheet-tab-labels-contained-workb.html)

Kelroy D B

Can one print a list of worksheet tab labels contained in a workb.
 
Is it possible to print a list of the tab labels contained within an Excel
workbook. If so, how?

Jason Morin

You can list the worksheet names in a new sheet and then
print the list from the

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

---
HTH
Jason
Atlanta, GA

-----Original Message-----
Is it possible to print a list of the tab labels

contained within an Excel
workbook. If so, how?
.



All times are GMT +1. The time now is 07:08 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com