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

Nifle
  • 34,998
xdazz
  • 253
  • 1
  • 4
  • 9

2 Answers2

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)

kurp
  • 1,004
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
fiona
  • 111