COMPARING TWO COLUMNS AND DISPLAYING MSGBOX
On Saturday, December 15, 2012 11:18:36 AM UTC-8, joeu2004 wrote:
wrote:
If Range("A1").Value Or Range("B1").Value Range("C1") Then
[....]
It's not clear to me why my line produces the msgbox when
both A1 & B1 are LESS than C1.
Because A1 < 0 (presumably).
Your if-statement reads: "if A1 is true or if B1 C1, then ....".
Any non-zero value is considered "true". So "if A1 is true" is false only
when A1 = 0.
Since "A1 is true" is (almost) always true, the true/false value of the 2nd
part (B1 C1) does not matter. "TRUE OR anything" is true.
Thanks, good stuff to digest for lurkers like me.
Howard
|