View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Chip Pearson Chip Pearson is offline
external usenet poster
 
Posts: 7,247
Default if statements with AND or OR condition criteria

Try something like

If (criterion1) And (criterion2) Then



--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com




"philwongnz"
wrote
in message
...

Hi guys,

Something simple but I can't get the syntax right IN VBA. I
would like
to have an IF statement in which it will test two values at
ONCE. Rather
then have an IF statement to test one value and another IF
statement to
test another value inside the first IF statement.

I know that I can do it in Java, but I just can't do it in VBA,
even in
Excel - you can use the AND(if(criteria), if(criteria)).

Pls help.


--
philwongnz
------------------------------------------------------------------------
philwongnz's Profile:
http://www.excelforum.com/member.php...o&userid=26283
View this thread:
http://www.excelforum.com/showthread...hreadid=399296