Wildcards

  • Thread starter Thread starter Guest
  • Start date Start date
anonymous,

Please at least post with a first name. It makes it seem more personal.
(It doesn't have to be your real name either)

For a formula solution, try this:
Type the text "Wildcard" into A1

=IF(ISERROR(SEARCH("*ldca*",A1)),"NG","OK")

If you're looking for a VBA solution, this might work for you.
By nature of the way the INSTR function works, it'll check
for the presence of one string within another. There is no
"wildcard", per se, but if the string that you're looking for
appears within the searched string, it'll give you the position
of where the match was found (which will always be greater
than zero.

Sub TestMe()
If (InStr(1, Range("A1"), "ildca")) > 0 Then
MsgBox "Match"
Else
MsgBox "No Match"
End If
End Sub

John
 
If you mean in VBA, probably not, but
Look at VBA help for LIKE, INSTR, MID, LEFT, RIGHT
 
Back
Top