can a cell be automatically populated with the workbook name?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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?
 
Try this,

=MID(CELL("filename",A1),FIND("]",CELL("filename",A1))+1,256)

Mike
 
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.
 
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
 
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...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top