Using Or in an If statement

J

Jase

Can I write and If statement saying
"If citeria is matched or_
citeria is matched or_
citeria is matched then
do something

end if"

Can you use or instead of doing a bunch of else if?
 
J

Jase

No I am trying to write it in VBA and I'm not really sure ho wto do that.

Thanks though
 
J

Jarek Kujawa

the answer to yr original question is yes

Sub sth

If cells(1,1).value = 1 or _
cells(1,1).value = 3 or _
cells(1,1).value = 7 Then

cells(1,2).value = "YES"

End if

End Sub
 
B

Bob I

The syntax is
IF(logical_test, value_if_true, [value_if_false])

Replace "logical_test" with citeria is matched or citeria is matched or
citeria is matched
 
Top