multiconditional code


Posted by amroo on April 26, 2001 12:30 AM

Bonjour,
I want to know if it's possible to code as this:
if ID=(12 or 14 or 23 or 32) then ....
else what is the solution?
a+mroo(the sign + means see you later in french).

Posted by Malc on April 26, 2001 12:37 AM

=if(or(A1=12,A1=14,A1=23,A1=32),"It's here","It's not here)

If ID is a range name substitute A1 for the rangename.
Haerera (or however it's spelt) means see ya later

Posted by Dave Hawley on April 26, 2001 2:03 AM

Hi Amroo


Best to use a Select Case statement for this, see below:

Sub Choice()
Select Case Id
Case 12, 14, 23, 14
'Your Code!
End Select
End Sub

Dave


OzGrid Business Applications

Posted by Dave Hawley on April 26, 2001 2:10 AM


Didn't see your ELSE :o)

Sub Choice()
Select Case Id
Case 12, 14, 23, 14
'Your Code!
Case Else
'Do something else
End Select
End Sub


+


OzGrid Business Applications

Posted by Aladin Akyurek on April 26, 2001 2:28 AM

If you are interested in building formulas, then here is an example:

=IF(OR(ID={12,14,23,32},...)

where ID is the name of the cell to be evaluated.

Salut.

Aladin Bonjour,



Posted by amroo on April 27, 2001 12:20 AM


I have to precise that the numbers 12 or 32 etc... are values in a combobox not range of cells. So when I click on one of them a conditional action runs.
Am I clear?
Amroo