Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
OR in IF
Do you know a way to include several conditions to one IFstep in VBA,
ie If condition1 OR condition2 OR condition3 then action1 without using my current unelegant and heavy: If condition1 then action1 If condition 2 then action1 If condition 3 then action1 I am sure the trick is easy..so easy that I cannot find it! Thanks in advance for your help, T2net |
#2
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
OR in IF
T2Net
=IF(OR(Condition1,Condition2,Condition3....),DoThi s,ElseDoThis) -- HTH Nick Hodge Microsoft MVP - Excel Southampton, England DTHIS web: www.excelusergroup.org web: www.nickhodge.co.uk "T2net" wrote in message ... Do you know a way to include several conditions to one IFstep in VBA, ie If condition1 OR condition2 OR condition3 then action1 without using my current unelegant and heavy: If condition1 then action1 If condition 2 then action1 If condition 3 then action1 I am sure the trick is easy..so easy that I cannot find it! Thanks in advance for your help, T2net |
#3
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
OR in IF
The or is a function like this with each condition separated by a comma:-
=IF(OR(A4=1,B4=2,C4=3),"Yes","No") -- Regards, OssieMac "T2net" wrote: Do you know a way to include several conditions to one IFstep in VBA, ie If condition1 OR condition2 OR condition3 then action1 without using my current unelegant and heavy: If condition1 then action1 If condition 2 then action1 If condition 3 then action1 I am sure the trick is easy..so easy that I cannot find it! Thanks in advance for your help, T2net |
#4
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
OR in IF
You've answered your own question:
If condition1 OR condition2 OR condition3 then action1 IS the solution. Try it! Regards, Stefi €žT2net€ť ezt Ă*rta: Do you know a way to include several conditions to one IFstep in VBA, ie If condition1 OR condition2 OR condition3 then action1 without using my current unelegant and heavy: If condition1 then action1 If condition 2 then action1 If condition 3 then action1 I am sure the trick is easy..so easy that I cannot find it! Thanks in advance for your help, T2net |
#5
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
OR in IF
Are you sure that's VBA?
-- David Biddulph "OssieMac" wrote in message ... The or is a function like this with each condition separated by a comma:- =IF(OR(A4=1,B4=2,C4=3),"Yes","No") -- Regards, OssieMac "T2net" wrote: Do you know a way to include several conditions to one IFstep in VBA, ie If condition1 OR condition2 OR condition3 then action1 without using my current unelegant and heavy: If condition1 then action1 If condition 2 then action1 If condition 3 then action1 I am sure the trick is easy..so easy that I cannot find it! Thanks in advance for your help, T2net |
#6
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
OR in IF
The shortened syntax (If <LogicalCondition Then response) looks like
reasonable, but I have several times had problems with it - so I prefer the full syntax: If Condition Then Action [ElseIf ElseCondition ElseIfAction] [Else ElseAction] End If In your case Condition is =condition1 Or condition2 Or condition3 -- Arvi Laanemets ( My real mail address: arvi.laanemets<attarkon.ee ) "Stefi" wrote in message ... You've answered your own question: If condition1 OR condition2 OR condition3 then action1 IS the solution. Try it! Regards, Stefi „T2net” ezt ?rta: Do you know a way to include several conditions to one IFstep in VBA, ie If condition1 OR condition2 OR condition3 then action1 without using my current unelegant and heavy: If condition1 then action1 If condition 2 then action1 If condition 3 then action1 I am sure the trick is easy..so easy that I cannot find it! Thanks in advance for your help, T2net |
#7
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
OR in IF
Thanks David. The question came up under Worksheet Functions on the Microsoft
Forum and I did not read it properly and missed the VBA at the end of the question and thought that a worksheet function was required. -- Regards, OssieMac "David Biddulph" wrote: Are you sure that's VBA? -- David Biddulph "OssieMac" wrote in message ... The or is a function like this with each condition separated by a comma:- =IF(OR(A4=1,B4=2,C4=3),"Yes","No") -- Regards, OssieMac "T2net" wrote: Do you know a way to include several conditions to one IFstep in VBA, ie If condition1 OR condition2 OR condition3 then action1 without using my current unelegant and heavy: If condition1 then action1 If condition 2 then action1 If condition 3 then action1 I am sure the trick is easy..so easy that I cannot find it! Thanks in advance for your help, T2net |
#8
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
OR in IF
On 28 fév, 09:48, Stefi wrote:
You've answered your own question: If condition1 OR condition2 OR condition3 then action1 IS the solution. Try it! Regards, Stefi "T2net" ezt írta: Do you know a way to include several conditions to one IFstep in VBA, ie If condition1 OR condition2 OR condition3 then action1 without using my current unelegant and heavy: If condition1 then action1 If condition 2 then action1 If condition 3 then action1 I am sure the trick is easy..so easy that I cannot find it! Thanks in advance for your help, T2net- Masquer le texte des messages précédents - - Afficher le texte des messages précédents - I knew it!! I had certainly a error mixed with the or last time I tried... Sorry for disturbing with my stupid question! Cheers |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|