LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
KR KR is offline
external usenet poster
 
Posts: 121
Default Using wildcard in VBA comparison? need a hint please.

I have three comboboxes on a worksheet that I pull values from. Each one has
a value of "All", followed by a list of items:

List 1:
All
Dog
Cat
Horse
etc.

I set a variable equal to each of the three combobox values (V1 ="Dog", V2 =
"Blue", V3 = "Pizza")

Now I need to loop through lines in a worksheet and check to see when
columns A, C, and D are equal to the individual info from the three
comboboxes. This is easy when I have specific values to match ("Dog") but
when I try to code for the "All" category I end up with a whole boatload of
embedded loops that end up confusing me and not working properly.

Essentially my original code looked something like:

If MyRange1 = V1 then
If MyRange2 = V2 then
If MyRange3 = V3 then
'do stuff
End if
End if
End if

If any selection is "All" I want to just skip that 'If' and keep going to
the next embedded if, rather than skipping over the whole section of code. I
looked at wildcards, but "Dog" isn't the same as "*", so that didn't work as
I'd hoped.

What would be the best approach to accept any MyRange value when my
comparison is "All"?

Many thanks in advance,
Keith


--
The enclosed questions or comments are entirely mine and don't represent the
thoughts, views, or policy of my employer. Any errors or omissions are my
own.


 
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 09:19 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"