ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Wild card in if then statements (https://www.excelbanter.com/excel-programming/296654-wild-card-if-then-statements.html)

jstocka

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

Don Guillett[_4_]

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




Frank Kabel

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



Trevor Shuttleworth

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




Dana DeLouis[_3_]

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




Josh[_10_]

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.


All times are GMT +1. The time now is 04:50 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com