3

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.)

  • 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
5

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)

1

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.