Thread: strings
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Dave Peterson Dave Peterson is offline
external usenet poster
 
Posts: 35,218
Default strings

one way:
=if(countif(a1,"*5 card charlie*")0,"Found it","nope")

or
=if(isnumber(search("5 card charlie",a1)),"yep","nope")

You could use Find (instead of Search) if you wanted case sensitive results.

RobcPettit wrote:

Hi, In range("a1") I have '20 Points - 5 Card Charlie' or '20 Points -
Black Jack'. The 'x Points -' can be any number. How do I ask in vba
does the sting contain '5 Card Charlie' or 'Black Jack'
Regards Robert


--

Dave Peterson