Linking tab names

  • Thread starter Thread starter eroszzz
  • Start date Start date
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
 
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
 
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top