Printing Sheet's Name

  • Thread starter Thread starter Gingit
  • Start date Start date
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.
 
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
 
Sheeloo,

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

Thanks.
 
How many sheets do you have?
Change
Dim i As Integer
to
Dim i As Long

and try
 
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.
 
Other solution: install the ASAP UTILITIES!!!
Have a Google on internet en download free!

Have fun!
 
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.
 
Thank you all it worked great!!!



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

Have fun!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Back
Top