Assigning Macros to Drop Down Boxes.


Posted by Scot Mann on April 05, 2001 5:56 AM

I am having trouble trying to assign macros to drop down boxes and I need help!

My spreadsheet has four drop down boxes and I'd like all of them to play off each other. For example, the first drop down box will list all of my companies products. The second drop down box has a list of product variations. I would like to set the spreadsheet up so once a product is selected in the first drop down box the second drop down box only displays the variations of that particular product and not variations for all products. Basically I'd like to filter the data as each drop down box is used. Is this possible?

When I try to assign a macro to a drop down box it only assigns it to the entire box and not to a particular component within the box and that's my question in a nutshell. Can you assign macros to components of a drop down box or just to the entire box in general?

I just know the basics regarding macros and have no experience with VBA.



Posted by steve on April 05, 2001 8:03 PM

What you need to do is run a match funtiontion off the first data validation. Then the match controls index's, the index's need to be in the source range of the second data validation box. Then repeat this for each box. I don't know much about filtering what I would do is to have lists of the data with the product name above each list, you will need to run your match off the product list. I'm not sure but I think pivot tables might also work for you.

steve