Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Multiple tests for a condition
Dear All,
I want to execute a statement if two cells meet the same condition (ie not empty). Basically, I want the vba syntax for the formula if(or(A1, B1, <""), doThing, doNoThing) Many TIAs Matilda |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Multiple tests for a condition
=if(and(a1<"",b1<""),"dothing", "donothing")
Matilda wrote: Dear All, I want to execute a statement if two cells meet the same condition (ie not empty). Basically, I want the vba syntax for the formula if(or(A1, B1, <""), doThing, doNoThing) Many TIAs Matilda -- Dave Peterson |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Multiple tests for a condition
Thanks Dave, but I want to put the test in a vba sub, in an if...then...else
statement. Sorry if I did not make myself clear. I tried concocting something like that statement , which I would put in a formula, and got error messages I couldn't interpret. Matilda "Dave Peterson" wrote: =if(and(a1<"",b1<""),"dothing", "donothing") Matilda wrote: Dear All, I want to execute a statement if two cells meet the same condition (ie not empty). Basically, I want the vba syntax for the formula if(or(A1, B1, <""), doThing, doNoThing) Many TIAs Matilda -- Dave Peterson |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Multiple tests for a condition
Matilda wrote:
Dear All, I want to execute a statement if two cells meet the same condition (ie not empty). Basically, I want the vba syntax for the formula if(or(A1, B1, <""), doThing, doNoThing) Many TIAs Matilda If Not IsEmpty(Range("a1")) Then If Not IsEmpty(Range("b1")) Then dostuff End If End If -- Gordon Rainsford London UK |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Multiple tests for a condition
A simple nested if! Negated.
Didn't occur to me... thanks Gordon! "Gordon Rainsford" wrote: Matilda wrote: Dear All, I want to execute a statement if two cells meet the same condition (ie not empty). Basically, I want the vba syntax for the formula if(or(A1, B1, <""), doThing, doNoThing) Many TIAs Matilda If Not IsEmpty(Range("a1")) Then If Not IsEmpty(Range("b1")) Then dostuff End If End If -- Gordon Rainsford London UK |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Multiple Conditional tests with Sumproduct | Excel Worksheet Functions | |||
Get highest scores multiple tests & students | Excel Discussion (Misc queries) | |||
Using Multiple Tests and Sounds With Worksheet Macros | Excel Discussion (Misc queries) | |||
Countif Using Multiple Logic Tests | Excel Worksheet Functions | |||
Average a group of tests for grade, some tests not taken by all. | Excel Discussion (Misc queries) |