Wildcard use in comparason.. Please help

  • Thread starter Thread starter KJ MAN
  • Start date Start date
K

KJ MAN

Here's my code.

For Each c In myrange
If UCase(c.Value) = UCase(Artist) Then

I need the match to return * Artist *. I need to to be
an exact match, or a match with characters preceeding and/or following.
I tried
Ucase("*" & Artist & "*")
and also
Ucase(* & Artist & *)

Neither worked. Any suggestions?
 
maybe...

if ucase(c.value) like Ucase("*" & Artist & "*") then

Did you really want spaces surrounding the Artist?

if ucase(c.value) like Ucase("* " & Artist & " *") then
 
Try it this way...

For Each c In myrange
If InStr(1, c.Value, "Artist", vbTextCompare) > 0 Then
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top