ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   how to print list of all worksheet names in a workbook? (https://www.excelbanter.com/excel-programming/355064-how-print-list-all-worksheet-names-workbook.html)

BAM100

how to print list of all worksheet names in a workbook?
 
Any way to do this? Sorry for such a basic question.

Thanks.

Richard

how to print list of all worksheet names in a workbook?
 
Create a module and put this code in it. Run the macro.

Sub PrintWorksheets()
Dim wks As Worksheet
Dim rng As Range

Set rng = Range("a1")

For Each wks In Worksheets
rng.Value = wks.Name
Set rng = rng.Offset(1, 0)
Next wks
End Sub

"BAM100" wrote:

Any way to do this? Sorry for such a basic question.

Thanks.



All times are GMT +1. The time now is 03:04 AM.

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