View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Graeme Graeme is offline
external usenet poster
 
Posts: 59
Default If / And / Or Macro

Mike - thanks for the quick response. I see how this would work as an excel
formula, but if it's a line of code in a macro, does it need to be expressed
differently? thanks.

"Mike H" wrote:

Try this

=IF(AND(A1="x",COUNTIF(A2:A10,"y")0),"Statement A","Statement B")

Mike

"Graeme" wrote:

Basic question: I am trying to write a macro that looks to see whether A1 =
"X" and also if any of A2...10 = "Y", then Statement A, else Statement B.
Thank you in advance.