worksheet name

imillar

New Member
Joined
Apr 8, 2002
Messages
6
i have multiple worksheets in a file, and would like to know if i can list the worksheet names on another worksheet for a summary.
 

Excel Facts

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},$Z$1:$Z$99,$Y$1:$Y$99),2,False) to lookup Y values to left of Z values.
Hi,

How about this?

Code:
Sub ListSheets()
Dim shtEnum As Object, shtDest As Worksheet, lngRow As Long

Set shtDest = Worksheets.Add
On Error Resume Next
shtDest.Name = "Sheet List"
shtDest.Range("A1").Value = "Sheet name"

lngRow = 2
For Each shtEnum In ActiveWorkbook.Sheets
    If shtEnum.Name <> "Sheet List" Then
        shtDest.Cells(lngRow, 1).Value = shtEnum.Name
        lngRow = lngRow + 1
    End If
Next shtEnum

End Sub

HTH,
Dan
 
Upvote 0
Hi


Run this code on the sheet you want you names in:

Code:
Sub AllSheet()
Dim i As Integer

    For i = 1 To ActiveWorkbook.Sheets.Count
        Cells(i, 1) = Sheets(i).Name
    Next i
 
End Sub
 
Upvote 0

Forum statistics

Threads
1,214,832
Messages
6,121,854
Members
449,051
Latest member
excelquestion515

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top