ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Excel Worksheets (https://www.excelbanter.com/excel-discussion-misc-queries/144219-excel-worksheets.html)

LPM7103

Excel Worksheets
 
How do I list the worksheets making up a workbook in Excel 2003?

Gord Dibben

Excel Worksheets
 
Private Sub ListSheets()
'list of sheet names starting at A1
Dim rng As Range
Dim i As Integer
Set rng = Range("A1")
For Each Sheet In ActiveWorkbook.Sheets
rng.Offset(i, 0).Value = Sheet.Name
i = i + 1
Next Sheet
End Sub


Gord Dibben MS Excel MVP

On Sat, 26 May 2007 08:46:01 -0700, LPM7103
wrote:

How do I list the worksheets making up a workbook in Excel 2003?



Don Guillett

Excel Worksheets
 
A shortie

Sub listwbshts()
For i = 1 To Worksheets.Count
Cells(i, 1) = Sheets(i).Name
Next i
End Sub

--
Don Guillett
SalesAid Software

"LPM7103" wrote in message
...
How do I list the worksheets making up a workbook in Excel 2003?




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

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