ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Sheets# and name (https://www.excelbanter.com/excel-programming/374175-sheets-name.html)

Quietman

Sheets# and name
 
Does anyone know how to get the sheet number as well as the sheet name to be
displayed in one excel worksheet

example: sheet37(foothill)
would like to be able to shoow this for all 37 sheet in one worksheet
--
Helping Is always a good thing

Otto Moehrbach

Sheets# and name
 
I don't know exactly what you mean by "sheet number", but the following
macro will list all the sheets like you want with the sheet "number" being
the sheet tab sequence. HTH Otto
Sub ListShts()
Dim ws As Worksheet
Dim c As Long
c = 1
For Each ws In ActiveWorkbook.Worksheets
Range("A" & Rows.Count).End(xlUp).Offset(1).Value = _
"Sheet" & c & "(" & ws.Name & ")"
c = c + 1
Next ws
End Sub
"QuietMan" wrote in message
...
Does anyone know how to get the sheet number as well as the sheet name to
be
displayed in one excel worksheet

example: sheet37(foothill)
would like to be able to shoow this for all 37 sheet in one worksheet
--
Helping Is always a good thing




Alok

Sheets# and name
 
Hi
Try this

Sub CreateListOfSheetsOnFirstSheet()
Dim i%, ws As Worksheet
For i = 1 To Worksheets.Count
With Worksheets(1)
Set ws = Worksheets(i)
.Cells(i, 1).Value = ws.Name & "(" & ws.CodeName & ")"
End With
Next i
End Sub


"QuietMan" wrote:

Does anyone know how to get the sheet number as well as the sheet name to be
displayed in one excel worksheet

example: sheet37(foothill)
would like to be able to shoow this for all 37 sheet in one worksheet
--
Helping Is always a good thing


Quietman

Sheets# and name
 
Thanks
--
Helping Is always a good thing


"Alok" wrote:

Hi
Try this

Sub CreateListOfSheetsOnFirstSheet()
Dim i%, ws As Worksheet
For i = 1 To Worksheets.Count
With Worksheets(1)
Set ws = Worksheets(i)
.Cells(i, 1).Value = ws.Name & "(" & ws.CodeName & ")"
End With
Next i
End Sub


"QuietMan" wrote:

Does anyone know how to get the sheet number as well as the sheet name to be
displayed in one excel worksheet

example: sheet37(foothill)
would like to be able to shoow this for all 37 sheet in one worksheet
--
Helping Is always a good thing



All times are GMT +1. The time now is 12:00 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com