Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,934
Default 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
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
Using the wildcard with IF DamienO New Users to Excel 5 January 29th 09 01:51 AM
If and wildcard Fish Excel Discussion (Misc queries) 3 October 1st 08 01:33 AM
wildcard JOUIOUI Excel Programming 5 July 31st 06 01:47 PM
Wildcard Robert[_30_] Excel Programming 1 May 18th 06 01:28 PM
Wildcard fugfug[_10_] Excel Programming 0 July 14th 05 12:34 PM


All times are GMT +1. The time now is 12:03 AM.

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

About Us

"It's about Microsoft Excel"