Tab name in a cell

  • Thread starter Thread starter Bob Berglund
  • Start date Start date
B

Bob Berglund

How can I get a sheet's Tab Name into a Cell?
Thanks for your help.
Bob
 
Bob,

In a formula, use

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

As a VBA Function, use

Function SheetName() As String
SheetName = Application.Caller.Parent.Name
End Function
 
Bob

With a macro.....

Sub NameInCell()
ActiveCell.Value = ActiveSheet.Name
''Range("A1").Value = ActiveSheet.Name
End Sub

With a formula...........

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

Note: if using formula, workbook must be saved at least once before getting
results.

Gord Dibben Excel MVP XL2002
 

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