ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Get a list of worksheets from a WB (https://www.excelbanter.com/excel-discussion-misc-queries/73996-get-list-worksheets-wb.html)

John Scott

Get a list of worksheets from a WB
 
How do I get a list of WS from a WB?

Jonah


Chip Pearson

Get a list of worksheets from a WB
 
John,

Try some code like

Sub AAA()
Dim Dest As Range
Dim WS As Worksheet
Set Dest = Range("A1") 'change as desired
For Each WS In ThisWorkbook.Worksheets
Dest.Value = WS.Name
Set Dest = Dest(2, 1)
Next WS
End Sub


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com



"John Scott" wrote in message
...
How do I get a list of WS from a WB?

Jonah





All times are GMT +1. The time now is 04:50 PM.

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