Dangerous_Dave
New Member
- Joined
- Jul 25, 2006
- Messages
- 38
Hi
I've spent ages trawling the net looking for an answer to this but am not having any luck pinpointing exactly what I want.
I want to set up 2 combo boxes - the list displayed in the second being dependant on the item selected in the first. The first combo box refers to a dynamic range, which I set up by typing the appropriate range name into the ListFillRange field in the combo box's properties. Thumbs up so far - great !!!
But now I want the second combo box to pick up the range name selected in the first combo box and to show me the list associated with that. I know it's going to need some code but I can't find any that works. My best hope, I thought, came from using the code in this link:
http://www.ozgrid.com/VBA/dependent-combobox.htm
...but the code didn't work. What I am doing different is to use two unattached combo boxes - ozgrid's example had them embedded in a userform. Does this make a difference at all ??? Property fields for combo boxes on the userform were certainly different from the property fields on my combo boxes. Any example that I found talked about using a userform but never said why. I could take the easy way out and just substitue my data into ozgrid's example. But I feel I'd just be copping out.
I know I don't want to use drop down lists and use the INDIRECT function - this spreadsheet will be used by lots of people and I think this option just looks cheap and nasty.
I know I don't want to use combo boxes from the forms toolbox because of font restrictions and general aesthetics.
I don't think I want to use a userform because it restricts my design more than I'd like.
I'm sure there must be a fairly simple bit of coding required to link the results of combobox1 to combobox2. Could anybody help me with an answer ???
I'm afraid I'm not allowed to post up real information but if anyone could demonstrate with the following simple example:
Range1 = Manufacturer (Ford, VW)
Range2 = Model (Fiesta, Focus, Mondeo; Golf, Passat, Scirocco)
...I'd be more than grateful.
Thanks
DD
I've spent ages trawling the net looking for an answer to this but am not having any luck pinpointing exactly what I want.
I want to set up 2 combo boxes - the list displayed in the second being dependant on the item selected in the first. The first combo box refers to a dynamic range, which I set up by typing the appropriate range name into the ListFillRange field in the combo box's properties. Thumbs up so far - great !!!
But now I want the second combo box to pick up the range name selected in the first combo box and to show me the list associated with that. I know it's going to need some code but I can't find any that works. My best hope, I thought, came from using the code in this link:
http://www.ozgrid.com/VBA/dependent-combobox.htm
...but the code didn't work. What I am doing different is to use two unattached combo boxes - ozgrid's example had them embedded in a userform. Does this make a difference at all ??? Property fields for combo boxes on the userform were certainly different from the property fields on my combo boxes. Any example that I found talked about using a userform but never said why. I could take the easy way out and just substitue my data into ozgrid's example. But I feel I'd just be copping out.
I know I don't want to use drop down lists and use the INDIRECT function - this spreadsheet will be used by lots of people and I think this option just looks cheap and nasty.
I know I don't want to use combo boxes from the forms toolbox because of font restrictions and general aesthetics.
I don't think I want to use a userform because it restricts my design more than I'd like.
I'm sure there must be a fairly simple bit of coding required to link the results of combobox1 to combobox2. Could anybody help me with an answer ???
I'm afraid I'm not allowed to post up real information but if anyone could demonstrate with the following simple example:
Range1 = Manufacturer (Ford, VW)
Range2 = Model (Fiesta, Focus, Mondeo; Golf, Passat, Scirocco)
...I'd be more than grateful.
Thanks
DD