J.E. McGimpsey said:
Try cutting and pasting this - it works fine for me. Make sure it's
in a regular code module (Insert/Module in the VBE), not the
ThisWorkbook or a Worksheet code module.
The one real change I made was to limit the worksheet name to 31
characters in case your workbook name was longer.
Public Sub ListSheets()
Dim i As Long
With Worksheets.Add(After:=Sheets(Sheets.Count))
.Name = Left("Sheets in " & ThisWorkbook.Name, 31)
For i = 1 To Sheets.Count - 1
.Cells(i, 1).Value = Worksheets(i).Name
Next i
End With
End Sub