M
mmel
I would like to have the name tab of a worksheet change to the entry in
a cell.
I have multiple sheets that all reference a master sheet. The master
sheet is the place where the user sets up the information for the other
sheets.
There are cells in the master setup sheet, where the user enters the
names of individual pieces of equipment. Each worksheet contains data
pertaining to one piece of equipment.
I found some VB code on Excel Tips and Tricks that works, but it only
renames the active sheet from a cell within it's own sheet.
Private Sub Worksheet_SelectionChange(ByVal Target As Excel.Range)
Set Target = Range("A1")
If Target = "" Then Exit Sub
On Error GoTo Badname
ActiveSheet.Name = Left(Target, 31)
Exit Sub
Badname:
MsgBox "Please revise the entry in A1." & Chr(13) _
& "It appears to contain one or more " & Chr(13) _
& "illegal characters." & Chr(13)
Range("A1").Activate
End Sub
I could use this and link a cell in the individual equipment's sheets
to the master sheet to get the name to the equipment sheets, but this
VB code only works on the active sheet. I would want it to update all
the tabs when names are entered in the master sheet, regardless of
whether the equipment sheets are active or not.
This workbook is used as template for many different groups of
equipment that are constantly changing, thus I cannot create a static
template for each group of equipment.
I hope this makes sense.
a cell.
I have multiple sheets that all reference a master sheet. The master
sheet is the place where the user sets up the information for the other
sheets.
There are cells in the master setup sheet, where the user enters the
names of individual pieces of equipment. Each worksheet contains data
pertaining to one piece of equipment.
I found some VB code on Excel Tips and Tricks that works, but it only
renames the active sheet from a cell within it's own sheet.
Private Sub Worksheet_SelectionChange(ByVal Target As Excel.Range)
Set Target = Range("A1")
If Target = "" Then Exit Sub
On Error GoTo Badname
ActiveSheet.Name = Left(Target, 31)
Exit Sub
Badname:
MsgBox "Please revise the entry in A1." & Chr(13) _
& "It appears to contain one or more " & Chr(13) _
& "illegal characters." & Chr(13)
Range("A1").Activate
End Sub
I could use this and link a cell in the individual equipment's sheets
to the master sheet to get the name to the equipment sheets, but this
VB code only works on the active sheet. I would want it to update all
the tabs when names are entered in the master sheet, regardless of
whether the equipment sheets are active or not.
This workbook is used as template for many different groups of
equipment that are constantly changing, thus I cannot create a static
template for each group of equipment.
I hope this makes sense.