Worksheet Names

T

Timmy Mac1

Is there any way of generating a list a worksheet names, as opposed t
Range Names, in a worksheet, or alternatively something that wil
reference a worksheet name, changing if the worksheet name i
subsequently changed?

I want to start putting explanation worksheets in my workbooks t
explain how the worksheets interact and what their purposes are, so an
comments along the lines of assisting with this would be gratefull
received. :
 
G

Gary''s Student

This tiny macro will return worksheet names:

Function nameit(i As Integer) As String
Application.Volatile
nameit = Worksheets(i).Name
End Function


For example, =nameit(1) will return the name of the first worksheet.
=nameit(2) will return the name of the second worksheet, etc.
 
B

Bob Phillips

Sub ListWorksheets()
Dim i As Long

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

End Sub

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)
 
Top