Listing the names of your worksheets

G

gunslinger

I've searched but haven't come up with an exact answer on this,
I want to use one empty worksheet to display a list of all of the worksheets
in the workbook. I will then be using the names in order to get data from
each sheet. I started doing it manually, just typing in the name of the
sheet, but there are way too many sheets and I've only made a dent so far.

Are there any formulas?
Macros?
Scripts?

I'd rather get a formula first, even if it's long and drawn out, and then a
macro. Last thing I'd try is the script.

Thanks in advance.
 
B

Bob Phillips

Macro.

SubSheetNames
Dim i As Long

For i = 1 To Activeworkbook.Worksheets.Count
Cells(i,"A").Value = Worksheets(i).Name
Next i
End Sub

--

HTH

Bob Phillips

(remove nothere from the email address if mailing direct)
 
S

SiC

Hi gunslinger,

I don't see a formula for what you're asking for, but you can try a simple
macro:

Sub SheetNames()

Dim i As Integer

For i = 1 To Sheets.Count
Sheets(Sheets.Count).Cells(i, 1).Value = Sheets(i).Name
Next i

End Sub

This will list all the names of the sheets starting from cell A1 of the last
sheet. Hope this helps.

-Simon
 
Top