tying combo boxes together

bucci35

Active Member
Joined
Jul 6, 2002
Messages
319
i have a combo box with categories in it
beef, poultry, lamb etc
I have another combo box with the items for each category.
What I want to do is tie these together so that when you click on beef for example it shows you all the beef products in the second combo box.
then when you select poultry in the first combo box it shows just the poultry items in the second combo box and etc.
Any ideas?

Thanks,
 

Excel Facts

How to fill five years of quarters?
Type 1Q-2023 in a cell. Grab the fill handle and drag down or right. After 4Q-2023, Excel will jump to 1Q-2024. Dash can be any character.

patrickmuldoon99

Active Member
Joined
Jun 27, 2006
Messages
345
You need to code into the on_change event of the first combo box, so as to populate the second combo box.

For example:

Code:
'code run on change event of combo box

Select case mycombo.value
case "Beef"
combo2.additem "Steak"
combo2.additem "MinceMeat"
case "Chicken"
combo2.additem "Nuggets"
combo2.additem "Wings"
end select
 

bucci35

Active Member
Joined
Jul 6, 2002
Messages
319
I"m not quite sure what you mean or how to do what you suggested. I didn't mention that the categories can total about 15, with the items for EACH category totalling at times 750.
 

erik.van.geit

MrExcel MVP
Joined
Feb 1, 2003
Messages
17,832
Hi,

take a look at this "famous" thread
(the link is already pointed to the "most relevant post")

http://www.mrexcel.com/board2/viewt...=0&postorder=asc&highlight=cascading&start=26

for a technique using comboboxes
http://www.mrexcel.com/board2/viewtopic.php?t=152281&start=5

see also this explanation
http://www.contextures.com/xlDataVal02.html

and
http://www.mrexcel.com/board2/viewtopic.php?t=15030&highlight=
feel free to send an email (no PM)
you'll get three files with examples

subject of email
cascading comboboxes

kind regards,
Erik
 

Forum statistics

Threads
1,136,925
Messages
5,678,601
Members
419,774
Latest member
MooseWinooski

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top