Worksheet Tab Names

fitzluck13

New Member
Joined
Nov 30, 2005
Messages
9
A previous user ask for code in relation to referencing a cell in a worksheet that will then use this cell to name the tab in the worksheet. See below code:

Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)
If Target.Address = "$A$1" Then Sh.Name = Target
End Sub

However when I add this to my workbook module the sheet tab name does not change. Can anyone provide some input as to what might be wrong?

Thank you
 

Excel Facts

Does the VLOOKUP table have to be sorted?
No! when you are using an exact match, the VLOOKUP table can be in any order. Best-selling items at the top is actually the best.

a7n9

Well-known Member
Joined
Sep 15, 2004
Messages
696
First add this code to "ThisWorkbook" object.
Only entering this code won't change the name of a worksheet, you'll have to actually change cell A1 and press enter.
 
Upvote 0

Forum statistics

Threads
1,195,630
Messages
6,010,780
Members
441,569
Latest member
PeggyLee

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
Top