Linking tab names

E

eroszzz

Is there a way to name a tab by linking it to a cell on the worksheet?
I have numerous worksheets whose tab name corresponds to the title i
cell A2 - I would love it if I could do a formula which would make th
tab names automatically be whatever is in A2. Any ideas
 
D

Don Guillett

right click sheet tab>view code>insert this. Now, when a2 changes so will
the tab name.

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address <> "$A$2" Then Exit Sub
ActiveSheet.Name = Target
End Sub
 
G

Gord Dibben

No formula AFAIK but Worksheet Event code can do it.

Private Sub Worksheet_Activate()
ActiveSheet.Name = Range("A2")
End Sub

Copy the above.

Right-click on a sheet tab and "View Code"

Paste the code in there.

Whenever this worksheet is activated, the sheet tab name will become whatever
is in A2.

Gord Dibben Excel MVP
 
Top