Conditionally Reducing Choices in Multiple Combo Boxes
I wonder if somebody can help me.....
Firstly....I am using Excel 2000 on a Win2000 PC
I have a user form that calls up a combo box to allow a user to make selections from a series of dropdowns (12 in all).
I use ONE range of data and each dropdown box references the SAME range.
It works fine....the user can (say) select box 1, make a selection and do the same for boxes 2-12.
The problem here is that once a user has made a selection from box 1, I do not want that particular choice to be available in the remaining boxes.
As the user goes down through the boxes, the available selections needs to reduce accordingly.
In other (simpler) words the selections need to be exclusive.
For simplicity reasons I only want to have one range to select from as it will be a long list. It will need updating regularly.
I initialise the dropdowns as follows....
Code:
Private Sub UserForm_Initialize()
For Each rngcell In Sheets("Data").Range("teamdata")
ComboBox1.AddItem rngcell.Value
ComboBox2.AddItem rngcell.Value
ComboBox3.AddItem rngcell.Value
ComboBox4.AddItem rngcell.Value
ComboBox5.AddItem rngcell.Value
ComboBox6.AddItem rngcell.Value
ComboBox7.AddItem rngcell.Value
ComboBox8.AddItem rngcell.Value
ComboBox9.AddItem rngcell.Value
ComboBox10.AddItem rngcell.Value
ComboBox11.AddItem rngcell.Value
ComboBox12.AddItem rngcell.Value
Next rngcell
End Sub
The combobox values are entered into a worksheet on execution of the macro.
Any ideas folks?
I would be most grateful if if somebody can help.
Many thanks in advance
Paul Hodges
OK guys - it works - thanks. One more question though!!
Thanks to both of you for your help.
Mark07, it seems like your code has done the trick.
I've attached it for your interest (and anyone elses).
Basically I've cut and pasted your work (thanks yet another time). I can't honestly say that I FULLY understand how it works but I'm largely there.:confused:
I've stripped all the maths and other macros etc that I had in the original workbook. It was running at 1.5mb and wasn't a good size to post here. This is JUST the input part of the process.
Interestingly, with this method there seems to be a pause between clicking on a dropdown and waiting for it to actually drop. It must be the time taken for the code to store the data and then read again. It was instantaneous before.
No complaints though, it only offers exclusive data as I asked.
I need some code to re-initialise the form when I click CLEAR. Any ideas? I did get some code for that a while back - couldn't make it work.
Bottom line...you guys really have helped. Both strangers to me and yet you found the time to help. The internet is a wonderful thing. :kiss :) :) :)
I will be happy to a part of this forum and help (in my limited way) in the future.
Regards,
Paul