How to reference tab name in cell in Excel?
For referencing the current sheet tab name in a cell in Excel, you can get it done with a formula or User Define Function. This tutorial will guide you through as follows.
Recommended Productivity Tools for Excel/Office
Please do as follow to reference the active sheet tab name in a specific cell in Excel.
1. Select a blank cell, copy and paste the formula =MID(CELL("filename",A1),FIND("]",CELL("filename",A1))+1,255) into the Formula Bar, and the press the Enter key. See screenshot:
Now the sheet tab name is referenced in the cell.
Besides the above method, you can reference the sheet tab name in a cell with User Define Function.
1. Press Alt + F11 to open the Microsoft Visual Basic for Applications window.
2. In the Microsoft Visual Basic for Applications window, click Insert > Module. See screenshot:
3. Copy and paste the below code into the Code window. And then press Alt + Q keys to close the Microsoft Visual Basic for Applications window.
VBA code: reference tab name
Function TabName() TabName = ActiveSheet.Name End Function
4. Go to the cell which you want to reference the current sheet tab name, please enter =TabName() and then press the Enter key. Then the current sheet tab name will be display in the cell.
With the Insert Workbook Information utility of Kutools for Excel, you can easily reference the sheet tab name in any cell you want. Please do as follows.
|Kutools for Excel : with more than 300 handy Excel add-ins, free to try with no limitation in 60 days.|
1. Click Kutools Plus > Workbook > Insert Workbook Information. See screenshot:
2. In the Insert Workbook Information dialog box, select Worksheet name in the Information section, and in the Insert at section, select the Range option, and then select a blank cell for locating the sheet name, and finally click the OK button.
You can see the current sheet name is referenced into the selected cell. See screenshot:
Kutools for Excel includes more than 300 handy Excel tools. Free to try with no limitation in 60 days. Download the free trial now!
Recommended Productivity Tools
Bring handy tabs to Excel and other Office software, just like Chrome, Firefox and new Internet Explorer.
Amazing! Increase your productivity in 5 minutes. Don't need any special skills, save two hours every day!
300 New Features for Excel, Make Excel Much Easy and Powerful:
- Merge Cell/Rows/Columns without Losing Data.
- Combine and Consolidate Multiple Sheets and Workbooks.
- Compare Ranges, Copy Multiple Ranges, Convert Text to Date, Unit and Currency Conversion.
- Count by Colors, Paging Subtotals, Advanced Sort and Super Filter,
- More Select/Insert/Delete/Text/Format/Link/Comment/Workbooks/Worksheets Tools...
You are guest ( Sign Up? )
or post as a guest, but your post won't be published automatically.
To post as a guest, your comment is unpublished.· 26 days agoFYI, you need to have more than one sheet in your workbook for this to work. Otherwise, the formula will display the filename but no sheet name.
To post as a guest, your comment is unpublished.· 3 months agoHi, using the =MID(CELL("filename",A1),FIND("]",CELL("filename",A1))+1,255) formula in desktop excel works, but not in online excel.. can you explain why that is?it returns #value error in the cell.
is there a workaround for this? Thanks!
To post as a guest, your comment is unpublished.· 1 years agoUsing the VBA macro, if I change the tab name the value in the cell does not get updated. Am I doing something wrong?
To post as a guest, your comment is unpublished.· 8 months agoDear John,
for best example let me tell you one thing.
if you want to change your code will be like this.
John = ActiveSheet.Name
To post as a guest, your comment is unpublished.· 1 years agoDear John,
The formula can't update automatically. You need to refresh the formula manually after changing the tab name.
Sorry about that.
To post as a guest, your comment is unpublished.· 1 years agoThank you very much. :-)