Display current sheet name
To display the current/active sheet name in a cell in Excel we can use two different formulas or use VBA
Example: Display current sheet name
This formula returns the name of the sheet where the formula is written.
|
Sub Display_current_sheet_name()
'display the name of the active sheet
ActiveSheet.Range("C4") = ActiveSheet.Name
ActiveSheet.Range("C4") = ActiveSheet.Name
End Sub
ADJUSTABLE PARAMETERS
Output Range: Select the output range by changing the cell reference ("C4") in the VBA code to any cell in the worksheet, that doesn't conflict with the formula.
Output Range: Select the output range by changing the cell reference ("C4") in the VBA code to any cell in the worksheet, that doesn't conflict with the formula.
EXPLANATION
To display the current/active sheet name in a cell in Excel we can use two different formulas or use VBA.
To display the current/active sheet name in a cell in Excel we can use two different formulas or use VBA.
FORMULAS
=MID(CELL("filename",A1),FIND("]",CELL("filename",A1))+1,255)
=RIGHT(CELL("filename",A1),LEN(CELL("filename",A1))-FIND("]",CELL("filename",A1)))
=MID(CELL("filename",A1),FIND("]",CELL("filename",A1))+1,255)
=RIGHT(CELL("filename",A1),LEN(CELL("filename",A1))-FIND("]",CELL("filename",A1)))
ARGUMENTS
A1: A1 is the cell reference, to cell (A1), of the the sheet where the formula is written.