How to correctly code
If N = 4 or 5 and If C = 0 Then
Can I use,
If N = (4 or 5) and C = 0 Then
If N = 4 or 5 Then
If C = 0 Then
Thx for the help ;-)
If N = 4 or N= 5 and C = 0 Then
I was thinking I might need to bracket the N as either 4 or 5 are good values for N but C must be 0 for both N Values.
thx, giving this a try
Nope, as I tought. Once C = 1, the If statement still ran. Oops
so, no go.
thx though for your help.
Yes, AND is processed before OR by the order of operations so you need parens.
If (N = 4 or N= 5) and C = 0
That's right, parentheses is missing from that post.
It should read
If (N = 4 or N= 5) and C = 0 Then
msgbox "N=4 and C=0"
Thx for confirming.