View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.misc
Gingit Gingit is offline
external usenet poster
 
Posts: 21
Default Printing Sheet's Name

Sheeloo,

After I press F5 it gave me a run time error subscript out of range.

Thanks.

"Sheeloo" wrote:

1. Insert a new sheet and name it SheetList
2. Press ALT-F11 to open VB Editor
3. Click Insert|Module
4. Paste the code below
Sub sheetList()
Dim i As Integer
i = 1
For Each ws In Worksheets
Sheets("SheetList").Cells(i, 1).Value = ws.Name
i = i + 1
Next
End Sub
5. Press F5
You will get the list in the new sheet... (including SheetList)
Press the

"Gingit" wrote:

I have a spreadsheet with a lot of sheets and wanted to know
Is there anyway to print only the sheet names
Thanks.