Tab name in a cell

  • Thread starter Thread starter Bob Berglund
  • Start date Start date
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
 
Back
Top