![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
New Member
Join Date: Apr 2002
Posts: 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.
|
|
|
|
|
|
#2 |
|
MrExcel MVP
Join Date: Feb 2002
Location: Sydney, Australia
Posts: 2,908
|
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
Dan |
|
|
|
|
|
#3 |
|
Banned
Join Date: Feb 2002
Posts: 1,582
|
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
|
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|