View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Jeff Jeff is offline
external usenet poster
 
Posts: 921
Default List all sheets present in Workbook

Perfect.... thank you

"Gord Dibben" wrote:

Jeff

Sub ListSheets()
'list of sheet names starting at A1
Dim rng As Range
Dim i As Integer
Set rng = Sheets("Sheet1").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 Thu, 9 Nov 2006 10:47:02 -0800, JEFF wrote:

Sorry.... Looking for it to list them in a column within Sheet 1, starting
in A1

"Gary''s Student" wrote:

Sub allsheet()
Dim w As Worksheet
For Each w In ActiveWorkbook.Worksheets
MsgBox (w.Name)
Next
End Sub
--
Gary's Student


"JEFF" wrote:

Hello,

Looking for some code that will return the names of all worksheets present
in the workbook. The number of sheets and their names change...

Help?!