Quantcast
Viewing all articles
Browse latest Browse all 4

Answer by assylias for "And" and "Or" troubles within an IF statement

The problem is probably somewhere else. Try this code for example:

Sub test()  origNum = "006260006"  creditOrDebit = "D"  If (origNum = "006260006" Or origNum = "30062600006") And creditOrDebit = "D" Then    MsgBox "OK"  End IfEnd Sub

And you will see that your Or works as expected. Are you sure that your ElseIf statement is executed (it will not be executed if any of the if/elseif before is true)?


Viewing all articles
Browse latest Browse all 4

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>