View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Dick Kusleika[_4_] Dick Kusleika[_4_] is offline
external usenet poster
 
Posts: 595
Default In Operator Equivalent

DrM

If Not IsError(Application.Match(x, Array("Me", "You", "Dog", "Boo"),
False)) Then

There really should be an easier way to do it.

--
Dick Kusleika
Excel MVP
Daily Dose of Excel
www.dicks-blog.com

Dr. M wrote:
Hello gang! I was wondering what is the VBA equivalent of the IN
operator. For instance, in SAS I might use:

IF x IN ("Me","You","Dog","Boo") THEN DO

instead of having to write

IF x="ME" or x="You" etc.

Thanks for your help!