Printing Sheet's Name

G

Gingit

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

Sheeloo

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
 
G

Gingit

Sheeloo,

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

Thanks.
 
S

Satti Charvak

Use this formula to show the sheet name.

=MID(CELL("filename",A1),FIND("]",CELL("filename",A1))+1,99)

advantage: no macro is required here
disdvantage: will not show the name properly till the file is saved.
 
F

Frederik

Other solution: install the ASAP UTILITIES!!!
Have a Google on internet en download free!

Have fun!
 
S

Satti Charvak

For the macro,
Sheeloo's answer was good

I've just removed the sheet name and it should work properly now.,

Sub sheetList()

Dim i As Integer
i = 1
For Each ws In Worksheets
Cells(i, 1).Value = ws.Name
i = i + 1
Next

endsub

Now. press f5 to execute the macro
--
Kind Regards,
Satti Charvak
Only an Excel Enthusiast
Noida, India


Satti Charvak said:
Use this formula to show the sheet name.

=MID(CELL("filename",A1),FIND("]",CELL("filename",A1))+1,99)

advantage: no macro is required here
disdvantage: will not show the name properly till the file is saved.

--
Kind Regards,
Satti Charvak
Only an Excel Enthusiast
Noida, India


Gingit said:
Sheeloo,

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

Thanks.
 
Top