I currently have a code that roughly looks like below.
At the moment, if I run this code, it will successfully execute on a row that meets condition1, but will skip condition2 and go straight to executing rows that meets condition3.
I want the code to execute all conditions, 1, 2, and 3. However, from what it seems like is happening is that as soon as condition1 is satisfied, it will then simply jump to check for condtion3.
I am trying to modify an original code that had only condition1 and condition2, which required it to be set up as If and ElseIf for it to work properly.
I thought if I simply added on the If condition3 at the end then it would still execute the original conditions correctly and then do the new additional condition3 afterwards, but that doesn't seem to be the case.
VBA Code:
If condition1 Then
[ statement1 ]
ElseIf condition2 Then
[ statement2 ]
End If
If condition3 Then
[ statement3 ]
End If
At the moment, if I run this code, it will successfully execute on a row that meets condition1, but will skip condition2 and go straight to executing rows that meets condition3.
I want the code to execute all conditions, 1, 2, and 3. However, from what it seems like is happening is that as soon as condition1 is satisfied, it will then simply jump to check for condtion3.
I am trying to modify an original code that had only condition1 and condition2, which required it to be set up as If and ElseIf for it to work properly.
I thought if I simply added on the If condition3 at the end then it would still execute the original conditions correctly and then do the new additional condition3 afterwards, but that doesn't seem to be the case.