View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Nigel[_2_] Nigel[_2_] is offline
external usenet poster
 
Posts: 735
Default worksheet change?


Put this in the 13th Sheet code, it will change ALL other worksheets in the
workbook. NOTE: if you have duplicate names the code will fail!

Private Sub Worksheet_SelectionChange(ByVal Target As Excel.Range)
Dim wS as worksheet
For each wS in Worksheets
ws.Name = ws.Range("G1")
Next
End Sub

--

Regards,
Nigel




"jack" wrote in message
...
I have the following brief macro to change the tab name based on a change
to
cell "G1":

Private Sub Worksheet_SelectionChange(ByVal Target As Excel.Range)
ActiveSheet.Name = ActiveSheet.Range("G1")
End Sub

How do I change the tab name on a total of 12 worksheets (different names)
when I make a change on the 13th worksheet?
The 12 worksheets all are linked to the 13 worksheet so that when I change
the 13th sheet, the others are updated and I would like to update (change)
the tab names when the the sheets are updated.
I've thought about placing the above macro in each worksheet but I can't
even get the one to update (name change) when I modify the 13th sheet.
Any guidance would be greatly appreciated.
Jack