Hello all
I am using this code in every sheet which changes the sheet name based on cell value. which works fine. However one Problem is, it only changes the name when a a user click anywhere on the sheet.
My question is , I do not want the user to see the sheet if the sheet name is Only between "1-10"
Cell "F1" get name from another sheet, If there is employee name there,
The sheet names are like
When there is no employee in another teh F1 value changes to only to number and obviously sheet names are then.
I need help in writing an additional code to the above which does the following.
Kachaloo
Apologies for any mistakes or not clearly explaining my point.
English is my 3rd language..
I am using this code in every sheet which changes the sheet name based on cell value. which works fine. However one Problem is, it only changes the name when a a user click anywhere on the sheet.
Code:
Private Sub Worksheet_SelectionChange(ByVal Target As Excel.Range)
Set Target = Range("F1")
If Target = "" Then Exit Sub
On Error GoTo Badname
ActiveSheet.Name = Left(Target, 31)
Exit Sub
End Sub
Cell "F1" get name from another sheet, If there is employee name there,
The sheet names are like
- "1 Firstname Surname"
- "2 Firstname Surname"
- .
- .
- .
- .
- .
- .
- .
- "10 Firstname Surname"
When there is no employee in another teh F1 value changes to only to number and obviously sheet names are then.
- "1"
- "2"
- .
- .
- .
- .
- .
- .
- .
- "10"
I need help in writing an additional code to the above which does the following.
- Change sheet names without go into that sheet and click anywhere there which changes the name.
- Show only those sheets where the name are like "1 Firstname Surname", "2 Firstname Surname" NOT only 1,2,...10
Kachaloo
Apologies for any mistakes or not clearly explaining my point.
English is my 3rd language..