Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Wild card in if then statements

What is the proper application of a wild card in an "if
then" statement. I am trying to select by the first three
letters of a field. using the asterik after the three
letters does not work all my resources do not show any
examples. Any ideas??
thanks
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,337
Default Wild card in if then statements

As always, it is best to post your code for comments.


--
Don Guillett
SalesAid Software

"jstocka" wrote in message
...
What is the proper application of a wild card in an "if
then" statement. I am trying to select by the first three
letters of a field. using the asterik after the three
letters does not work all my resources do not show any
examples. Any ideas??
thanks



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,885
Default Wild card in if then statements

Hi
try something like
If lcase(left(activecell.value,3))="abc" then
msgbox "starts with 'abc'"
end if

--
Regards
Frank Kabel
Frankfurt, Germany

"jstocka" schrieb im Newsbeitrag
...
What is the proper application of a wild card in an "if
then" statement. I am trying to select by the first three
letters of a field. using the asterik after the three
letters does not work all my resources do not show any
examples. Any ideas??
thanks


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,089
Default Wild card in if then statements

One way:

=IF(LEFT(Q11,3)="abc","good","bad")

Regards

Trevor


"jstocka" wrote in message
...
What is the proper application of a wild card in an "if
then" statement. I am trying to select by the first three
letters of a field. using the asterik after the three
letters does not work all my resources do not show any
examples. Any ideas??
thanks



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 690
Default Wild card in if then statements

Not sure what you are looking for. Is this what you mean by a "wild card?"

Sub Demo()
If ActiveCell Like "[A-Z,a-z][A-Z,a-z][A-z,a-z]*" Then
MsgBox "Starts w/ 3 Letters"
End If
End Sub

--
Dana DeLouis
Using Windows XP & Office XP
= = = = = = = = = = = = = = = = =


"jstocka" wrote in message
...
What is the proper application of a wild card in an "if
then" statement. I am trying to select by the first three
letters of a field. using the asterik after the three
letters does not work all my resources do not show any
examples. Any ideas??
thanks





  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Wild card in if then statements

"jstocka" wrote in message ...
What is the proper application of a wild card in an "if
then" statement. I am trying to select by the first three
letters of a field. using the asterik after the three
letters does not work all my resources do not show any
examples. Any ideas??
thanks


This may not be what you need but you can grab the first three letters
of a cell w/ =Left(A1,3) This will give you the first 3 letters of
whatever is in cell A1 & then you can go from there.
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Wild Card Search fi.or.jp.de Excel Worksheet Functions 2 August 3rd 09 07:56 PM
Wild card * in Array ATL_Gabriel Excel Worksheet Functions 1 January 29th 09 11:32 PM
Wild Card Vlookups [email protected] Excel Discussion (Misc queries) 2 January 7th 08 07:27 PM
Wild Card Search roy.okinawa Excel Worksheet Functions 4 January 30th 06 10:42 PM
Wild card * Herman Excel Worksheet Functions 0 October 21st 05 01:39 PM


All times are GMT +1. The time now is 05:06 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"