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

Thanks Nigel
I get an error message for line:
ws.Name = ws.Range("G1")
I don't have duplicate names.
Any ideas why it isn't working?
Jack

"Nigel" wrote in message
...

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