PDA

View Full Version : Combo box



cavemonkey
07-13-2008, 07:24 PM
Hi

I need to come up with a userform using combo boxes.

I have

cmb1: 1 2 3
cmb2: 1.1 2.1 3.1
1.2 2.2 3.2
1.3 2.3 3.3

I have 2 combo boxes.

how do i make sure that if i click 1 on cmb1, i will get the options 1.1/1.2/1.3 in cmb2. and likewise for 2 in cmb1, i will get options 2.1/2.2/2.3 in cmb2? I've defined Name for 1.1/1.2/1.3, 2.1/2.2/2.3 etc already. So how i can link the option in cmb1 to make it recognize the Name i've defined and make it the RowSource for the cmb2??

But the all the options in cmb2 acutally represent different spreadsheets in the excel file.

Pls advise. Thanks.

lucas
07-13-2008, 09:58 PM
Does it have to use the named range? You should post your workbook so we can see where things are located. Try this in the meantime......it just uses additem and might give you some ideas.

cavemonkey
07-13-2008, 10:30 PM
it would be much more preferable if i can use the named range. Next time i would need to continue to add on the list, so if i use the named range, it would automatically be included in the drop down list and not use vba to
Additems.

anw, the Sheets like CP/ESP/IPF(these will be in cmbCP and are the 1/2/3 previously mentioned) contains the list that i wan to put in combo box 2, namely cmbCA. and the list inside each sheets are actually the 1.1/1.2/1.3 (there're alot, so i don't really want to Additem to add of it)

thanks alot

cavemonkey
07-15-2008, 07:14 PM
i would need to use do this as user friendly as possible as i would not be the one using this form ultimately.

Emergency Response, or '1' , when chosen, would cause Critical Activity combo box to have the list of activities in the ER sheet. these list of activites are the '1.1' , '1.2' , '1.3' .....

any help would be greatly appreciated!

mdmackillop
07-16-2008, 12:06 AM
Private Sub cboCP_Change()
cboCA.RowSource = cboCP
End Sub