Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
if statements with AND or OR condition criteria
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 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
if statements with AND or OR condition criteria
if myVar1 = "ok" _
and myVar2 = "do it now" then 'both are true else 'at least one is false. end if === and in excel, I bet you'd use: =if(and(criteria1,criteria2), ... philwongnz wrote: 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 -- Dave Peterson |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
if statements with AND or OR condition criteria
Search XL VBA for 'and operator' (w/o the quotes).
-- Regards, Tushar Mehta www.tushar-mehta.com Excel, PowerPoint, and VBA add-ins, tutorials Custom MS Office productivity solutions In article , says... 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 |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
IF statements with multiple criteria | Excel Worksheet Functions | |||
Multiple criteria IF statements? | Excel Worksheet Functions | |||
Count Unique with criteria condition | Excel Worksheet Functions | |||
condition statements | Excel Worksheet Functions | |||
Assign ID based on condition(criteria) | Excel Programming |