list sheets in workbook
Hi,
I am assuming sheet1 is the first sheet in your workbook. Right click a
sheet tab, view code and paste this in and run it
Sub Sonic()
For x = 2 To Worksheets.Count
Sheets("Sheet1").Cells(x - 1, 1).Value = Sheets(x).Name
Next
End Sub
If sheet 1 isn't the first sheet then use this
Sub Sonic()
For x = 1 To Worksheets.Count
If Sheets(x).Name < "Sheet1" Then
Sheets("Sheet1").Cells(x - 1, 1).Value = Sheets(x).Name
End If
Next
End Sub
Mike
"John" wrote:
Hello to all...
I have found this community to be very helpful for a new user like me. I
have used many examples displayed throughout the sessions. What I would like
to do is list the sheets in my workbook on sheet 1 but exclude sheet 1 in the
list, starting with sheet 2 through sheet end.
I have found the code that list all sheets which will work but I would like
to eliminate the first sheet though.
Any example of code would be nice. Thanks in advance...
|