Hi - Can anyone clarify why I am recieving the "End if without block if" error . See code below. Essentially, based on a cell value trigger, I am trying to change a worksheet name.
Private Sub Worksheet_Change(ByVal Target As Range)
If Intersect(Target, Range("A1")) Is Nothing Then Exit Sub
Application.ScreenUpdating = False
Dim ws As Worksheet
If Target.Address = "$A$1" And Target = "Interface" Then
For Each ws In ActiveWorkbook.Worksheets
If ws.Name = "Co. Desc Category - Pick List" Then ws.Name = "co_desc_category_code_interface"
End If
Next ws
ElseIf Target.Address = "$A$1" And Target = "Client" Then
For Each ws In ActiveWorkbook.Worksheets
If ws.Name = "co_desc_category_code_interface" Then ws.Name = "Co. Desc Category - Pick List"
End If
Next ws
End If
Private Sub Worksheet_Change(ByVal Target As Range)
If Intersect(Target, Range("A1")) Is Nothing Then Exit Sub
Application.ScreenUpdating = False
Dim ws As Worksheet
If Target.Address = "$A$1" And Target = "Interface" Then
For Each ws In ActiveWorkbook.Worksheets
If ws.Name = "Co. Desc Category - Pick List" Then ws.Name = "co_desc_category_code_interface"
End If
Next ws
ElseIf Target.Address = "$A$1" And Target = "Client" Then
For Each ws In ActiveWorkbook.Worksheets
If ws.Name = "co_desc_category_code_interface" Then ws.Name = "Co. Desc Category - Pick List"
End If
Next ws
End If