Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Create a help hint for a UDF | Excel Worksheet Functions | |||
any hint for using excel to create a model? | Excel Discussion (Misc queries) | |||
column hint | Excel Programming | |||
how to make a help hint for my function made by myself. | Excel Programming | |||
Wildcard in conjunction with data comparison | Excel Programming |