worksheet tabs

j3andc

Board Regular
Joined
Mar 4, 2002
Messages
172
Is there a formula in Excel that will display the worksheet tab name when requested?

Thanks
 

Excel Facts

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.
Someone out there correct me if this is not the shortest or most efficient formula, but try:

=RIGHT(CELL("filename"),LEN(CELL("filename"))-SEARCH("]",CELL("filename")))

and be sure to immediately save the workbook.

BTW, the VBA line of code to do this is

[A1] = ActiveSheet.Name

Tom Urtis
 
Upvote 0
Thanks for the response, but I do not believe
this works with multiple sheets. Every time that it recalculates every sheet takes on the same worksheet tab name. Maybe I have done it incorrectly.
 
Upvote 0
Try pasting this into your workbook module, which will do the trick for all sheets in the workbook. Right click on the Excel workbook icon to the left of the File menu, near the upper left corner of the screen, then left click on View Code, and paste this in:

Private Sub Workbook_SheetActivate(ByVal Sh As Object)
[A1] = ActiveSheet.Name
End Sub

Or, if you only want certain sheets that you decide shall have the sheet name displayed, use this code instead, by right clicking on the specific sheet tab(s), left clicking on View Code, and pasting this in:

Private Sub Worksheet_Activate()
[A1] = ActiveSheet.Name
End Sub

Tom Urtis
 
Upvote 0

Forum statistics

Threads
1,213,536
Messages
6,114,215
Members
448,554
Latest member
Gleisner2

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top