Trying to figure out why this isn't working.
When I change B2 to any number, it works fine and the sheet name is change to the corresponding number.
But if I clear out the contents to B2 to blank, the sheet name stays the same as the previous number that was in B2. I would like it to change to "Template" (no quotes)
Any ideas? I feel like it is blatantly obvious ......
Thanks a million!
-Spydey
When I change B2 to any number, it works fine and the sheet name is change to the corresponding number.
But if I clear out the contents to B2 to blank, the sheet name stays the same as the previous number that was in B2. I would like it to change to "Template" (no quotes)
Any ideas? I feel like it is blatantly obvious ......
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
Application.EnableEvents = False
Set Target = Range("B2")
If Len(Target.Value) = 0 Then
Application.ActiveSheet.Name = "Template"
ElseIf IsNumeric(Target.Value) = True Then
Application.ActiveSheet.Name = Target
End If
Application.EnableEvents = True
End Sub
Thanks a million!
-Spydey
Last edited: