Subscribe now and choose from over 30 free gifts worth up to £49 - Plus get £25 to spend in our shop
I have a two comboboxes the contents of the second depend on what ws selected from the first
How can it be done? i assume it can be
create your first combo box
In another cell (say A1) create a conditional link that gives you either a 0 or a 1 (or 2 or 3 depending on the number of different fill lists you propose for your second combo box) depending on the selection from your first combo box.
for your second combo box create your two (or more) fill lists in say, b1:b5 and c1:c5 etc
now go to Insert>Name>Define and give a name to your second combo box fill list volatile range (say combo2list) and define it as =OFFSET(Sheet1!$B$1, 0, Sheet1!$A$1, 5, 1)
this makes the range change according to the number of columns it should jump right (driven by the first combi result in A1) to retrieve the dro pdown list from.
email me if you want a demo xls file to show you.
I was hoping that there was a way to keep it in the userform rather than calling between the userform and the worksheets
ahh, sorry. Im not very good with standalone forms.
Probably need to do it in the VBA then wont you?
you mean in VBA?
I would have the second list in a collection then update the collection using when the first list has changed.
SOOOooo
If you choose 2 in the fist box
you populate your collection with the values for 2, then load them into the combobox values.
thanks stoner, looks just the thing. Will investigate more tomorrow the snow is coming and i have better things to do than watch it fall.
when the first combobox is used it runs some VBA code which changes the ListFillRange of the second
So, in the code for combobox1
Private Sub ComboBox1_Change()
ComboBox2.ListFillRange = "A1:A10"
End Sub
where the items you want to appear in combo2 are listed in cells A1:A10
