To post as a guest, your comment is unpublished.· 4 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.· 9 months agoDear John,
The formula can't update automatically. You need to refresh the formula manually after changing the tab name.
Sorry about that.
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
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.
1. Click Enterprise > 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 120 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.· 10 months 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.· 1 years agoThank you very much. :-)