View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.misc
Don Don is offline
external usenet poster
 
Posts: 487
Default Macro if and / or statement

why not try
=IF(AND(OR(A1="London",A1="Cambridege"),B1<"VOY") ,"good","")

"orquidea" wrote:

Hi:

I am having difficulty writing a macro with the if and /or together.

Column C will be = "GOOD" if B is different than "VOY" and A is iqual to
London and Cambridge.

A B C
London VOY
Cambridege GOOD
London GOOD

I have the below string but it is just evaluating the second part of the
string
Do (the and conditions)
If ActiveCell.Offset(0, -1) < "VOY" And ActiveCell.Offset(0, -2) = "
London" Or ActiveCell.Offset(0, -2) = "Cambridge" Then
ActiveCell.Value = "GOOD"
ActiveCell.Offset(1, 0).Select
Else
ActiveCell.Offset(1, 0).Select
End If
Loop Until ActiveCell.Offset(0, -13) = ""

Could anyone help me please.

Thanks,
Orquidea