View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Nigel[_2_] Nigel[_2_] is offline
external usenet poster
 
Posts: 735
Default VBA code with and / or statement

Think of each logical test returning a TRUE or FALSE

......("b10") < "" is TRUE if NOT equal empty string
......("b19") < "" is TRUE if NOT equal empty string

If you want BOTH to be TRUE then you must AND them, otherwise OR will return
TRUE if either is TRUE.

Finally the last test ...("b11:aa11") is TRUE if the values are = empty
strings; since you want this condition to be TRUE and the previous condition
to also be TRUE you should AND these as well.


--

Regards,
Nigel




"Steve" wrote in message
...
I cannot get this to run the [ELK] macro when these 3 conditions are
met. It worked until I added the OR statement. I would really like
it to check if the reference cells have numbers in them. Then if NOT
run the ELK macro. If Sheet1.Range("b10").Value < "" Or
Sheet1.Range("b19").Value < "" And Sheet1.Range("b11:aa11").Value =
"" Then [ELK]

Thanks for any help you can provide