can a cell be automatically populated with the workbook name?

C

crawdood

I have a workbook with more than 50 worksheets; iwould like a cell in each
worksheet to automatically dispaly the tab name of that worksheet - is this
possible?
 
D

David Biddulph

Assuming that you mean worksheet name, as in the text of your message, and
not workbook name, as in the subject line, then:
=MID(CELL("Filename",A1),FIND("]",CELL("Filename",A1))+1,255)
Note that you need to save the file before this will take effect.
 
G

Gord Dibben

Also note that you can group the sheets and enter the formula in a cell on the
active sheet.

Will be entered in that cell on all sheets.


Gord Dibben MS Excel MVP
 
R

ryguy7272

Mike and David supplied some great suggestions for you. In addition, you may
also want to try this:

Sub ListSheets()
Dim rng1 As Range
Dim I As Integer
Dim sh As Worksheet
Dim blnReplace As Boolean
Set rng1 = Range("A3")
For Each Sheet In ActiveWorkbook.Sheets
blnReplace = False
rng1.Offset(I, 0).Value = Sheet.Name
I = I + 1
Next Sheet
End Sub

Write back if you have any questions...
 
Top