View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
somethinglikeant somethinglikeant is offline
external usenet poster
 
Posts: 94
Default List sheet names

Hi Steven this should do it

Sub ListSheets()
Sheets.Add after:=Sheets(Sheets.Count): ActiveSheet.Name = "Sheet
Names"
[A1] = "Sheet Names": ActiveCell.Font.Bold = True: ActiveCell.Offset(1,
0).Select
Dim sht As Worksheet
For Each sht In Worksheets
If sht.Name < "Sheet Names" Then
ActiveCell = sht.Name
ActiveCell.Offset(1, 0).Select
End If
Next sht
End Sub

http://www.excel-ant.co.uk




StevenP wrote:
Hi there,

Can anybody help me with the code the generate a list of all the sheet names
in my workbook.

Preferably the code should create a new sheet in the workbook and then list
all the names starting in cell A1, going down.

Thanks for the help.

Regards,

Steven P