IF
whithout END IF
, i think you must add END IF
before END SUB
, Try like thisPrivate Sub Worksheet_Change(ByVal Target As Range)
On Error Resume Next
If Not Range("A2").Value = "" Then
ThisWorkbook.Sheets(Range("A2").Value).Select
End If
End Sub
If Not Application.Intersect(Range("A2"), Target) Is Nothing Then _
ThisWorkbook.Sheets(Target.Value).Activate
IF
whithoutEND IF
, i think you must addEND IF
beforeEND SUB
, Try like this
VBA Code:Private Sub Worksheet_Change(ByVal Target As Range) On Error Resume Next If Not Range("A2").Value = "" Then ThisWorkbook.Sheets(Range("A2").Value).Select End If End Sub
thanksIF
whithoutEND IF
, i think you must addEND IF
beforeEND SUB
, Try like this
VBA Code:Private Sub Worksheet_Change(ByVal Target As Range) On Error Resume Next If Not Range("A2").Value = "" Then ThisWorkbook.Sheets(Range("A2").Value).Select End If End Sub