View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Jim May Jim May is offline
external usenet poster
 
Posts: 430
Default List sheet names

Hi somethinglikeant;
Stepped through your code mostly to see the "affect" of
The two ":"'s in line 2 and 3. Noted that they serve
To act as Separators or parameters; just hadn't noticed
This before being faily new to all this. Can you comment
On their use/purpose, or have I guessed correctly?
TIA,


"somethinglikeant" wrote in message
oups.com:

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