View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
tod tod is offline
external usenet poster
 
Posts: 114
Default Custom Functions

If you are speaking of VBA code, you would use AND and OR
like this:

Dim MyName as String

MyName = "tod"

If MyName = "tod" and MyName < "Fred" Then
'code
End If

IF MyName = "tod" or MyName = "Fred" Then
'code
End If



If you are using a formula:

=If(And(A1="tod",B1<"Fred"),True,False)

=If(Or(A1="tod",A1="Fred"),True,False)

tod

-----Original Message-----
Want to use and mix multiple AND and OR in condition
statement in Custom Function.

Format as "If Condition1 and Condition2 and etc.

Does not work.

Assistance requested.

Thanks
.