I have a quick question regarding some VB syntax. Basically, I want to check the 1st if statement and its true, and go to BPNum, I want to skip the rest of the code and go to the end of the subroutine, I do not want it to go back and execute the last bit of code.
Here is my code:
I know that with GoTo, after it is done executing wherever you "WentTo" it goes back and executes the next line of code, which is why it's executing BPName, is there any way I can make this skip BPName??
Here is my code:
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
Dim ws As Worksheet
'I have to validate the sheet change before doing anything
Set ws = s_BPSummary
If ws.Range("E3") <> ws.Range("A1") Then
GoTo BPNum
ElseIf ws.Range("E4") <> ws.Range("B1") Then
GoTo BPName
End If
BPNum:
Application.EnableEvents = False
ws.Range("A1") = ws.Range("E3")
Call Move_Details_To_Summary
Application.EnableEvents = True
GoTo finish
BPName:
Application.EnableEvents = False
ws.Range("B1") = ws.Range("E4")
Call Move_Name_Details_To_Summary
Application.EnableEvents = True
finish:
End Sub
I know that with GoTo, after it is done executing wherever you "WentTo" it goes back and executes the next line of code, which is why it's executing BPName, is there any way I can make this skip BPName??