Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Using wildcard in VBA comparison? need a hint please.

You can't use a wildcard in an equality comparison. You can look at the
Like operator


if Myrange.Value like "*" then

? "dog" like "*"
True
? "a$@Afsldkf" like "*"
True

not sure how that is a savings over

v1 = "All"

but you seem to be fixated on it.

--
Regards,
Tom Ogilvy


"KR" wrote in message
...
The proposed solution of multiple statements did work; the one that I'm
still curious about (wildcards) I never got working- I tried replacing the
string of "All" with the string of "*" (if V1 = "All" then V1 = "*") but
when I used statements like:

If MyRange1 = V1 then 'etc.

where MyRange1 = "dog" and now my V1 = "*", it was comparing the actual
strings - which aren't equal - instead of somehow incorporating the "*" as

a
wildcard. I suspect there is some syntax specific to the use of wildcards
that I didn't find in my search of the help file. I'll keep looking...

:)

Thanks,
Keith



"Tom Ogilvy" wrote in message
...
All isn't a wildcard, so you would still have to recognize that the
selection is All. If you are going to determine that, then it would be
redundant to try to use a wildcard.





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
Create a help hint for a UDF Mary Excel Worksheet Functions 3 October 9th 09 11:14 AM
any hint for using excel to create a model? gipsassignment Excel Discussion (Misc queries) 1 October 19th 05 02:49 PM
column hint Tom Ogilvy Excel Programming 3 September 26th 04 10:34 PM
how to make a help hint for my function made by myself. steve Excel Programming 2 August 22nd 03 02:11 AM
Wildcard in conjunction with data comparison Tom Excel Programming 3 August 4th 03 02:24 PM


All times are GMT +1. The time now is 11:38 PM.

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

About Us

"It's about Microsoft Excel"