cole516gray
New Member
- Joined
- Dec 2, 2013
- Messages
- 6
I found a code to make the tab name equal a cell in the worksheet:
This worked great for the first worksheet, but it is not working for any of the other sheets. Can anyone tell me if I am missing something in the code?
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
Const WS_RANGE As String = "ad1" '<== change to suit
On Error GoTo ws_exit
Application.EnableEvents = False
If Not Intersect(Target, Me.Range(WS_RANGE)) Is Nothing Then
With Target
Me.Name = .Value
End With
End If
ws_exit:
Application.EnableEvents = True
End Sub
This worked great for the first worksheet, but it is not working for any of the other sheets. Can anyone tell me if I am missing something in the code?
Last edited by a moderator: