Home |
Search |
Today's Posts |
|
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Wildcard use in comparason.. Please help
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? |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Wildcard use in comparason.. Please help
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 KJ MAN wrote: 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? -- Dave Peterson |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Wildcard use in comparason.. Please help
Try it this way...
For Each c In myrange If InStr(1, c.Value, "Artist", vbTextCompare) 0 Then -- Rick (MVP - Excel) "KJ MAN" wrote in message ... 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? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Using the wildcard with IF | New Users to Excel | |||
If and wildcard | Excel Discussion (Misc queries) | |||
wildcard | Excel Programming | |||
Wildcard | Excel Programming | |||
Wildcard | Excel Programming |