Thread: strings
View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
RobcPettit[_2_] RobcPettit[_2_] is offline
external usenet poster
 
Posts: 108
Default strings

Thankyou for your reply. This is great for in the worksheet, but i need
to do it in vba.
Regards Robert
Dave Peterson wrote:
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