View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
joeu2004[_2_] joeu2004[_2_] is offline
external usenet poster
 
Posts: 829
Default COMPARING TWO COLUMNS AND DISPLAYING MSGBOX

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.