Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have an excel file which has a lot of sheets. How could I get a list of sheet names of ms-excel?

(PS: The office is mac version.)

share|improve this question
    
from external? from within the document? as a macro? etc etc. – akira Sep 21 '12 at 6:35
    
@akira Within the document. No matter whether use a macro, just want to export a list of names as text. – xdazz Sep 21 '12 at 6:57
up vote 3 down vote accepted

Try using the following macro:

Sub ListWorkSheetNames()

For i = 1 To Sheets.Count
Range("A" & i) = Sheets(i).Name
Next i

End Sub

For me - works quite well.

(source)

share|improve this answer

To get the same as above but additionally with hyperlinks taking you to the sheet:

Sub ListWorkSheetNames()

For i = 1 To Sheets.Count
Range("A" & i) = "=HYPERLINK('" + Sheets(i).Name + "'!A1, """ + Sheets(i).Name + " "")"
Next i

End Sub
share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .