I’m trying to use “And” & “Or” within an If statement. I probably have my syntax wrong.
the result comes back false when the data should make it true. Here is the code:
ElseIf (origNum = "006260006" Or origNum = "30062600006") And creditOrDebit = "D" Then
'do things here
End If
-When I debug and come to this line it hops over it and doesn’t enter in.
-origNum actually equals “006260006” and creditOrDebit = “D”.
-so I’m assuming my “Or” statement isn’t working.
-Hopefully this is a quick easy question. Thanks!
The problem is probably somewhere else. Try this code for example:
And you will see that your
Orworks as expected. Are you sure that yourElseIfstatement is executed (it will not be executed if any of the if/elseif before is true)?