I have an excel File with three columns. Each row is unique. There are three comboboxes corresponding to those three columns.
When an option in the first combobox is selected, I want the second combobox to be populated with items from the second column corresponding to the selection from the first combobox. ie:
- Adam | Apple | Seed
- Adam | Apple | Core
- Adam | Orange | Peel
- Jess | Banana | Peel
- Jess | Mango | Pulp
- Jess | Orange | Seed
Here the first column has data Adam, Jess. The first combobox already has two unique options Adam and Jess.
Once the user has selected either Adam or Jess the second combobox should be populated with corresponding fruit names.
Ex. Combobox1 = Adam
then combobox2 ={Apple, Orange}
when either Apple / Orange are selected then the third combobox should have options correspoding to the first two comboboxes.
Please note that my first combobox is already populated with data correctly:
Function UniqueList()
'Populate control with
'unique list.
Range("Names").AdvancedFilter Action:=xlFilterCopy, _
CopyToRange:=Range("uniqueNames"), Unique:=True
'Set combo control's Row Source property.
Range("uniqueNames").RemoveDuplicates Columns:=1, Header:=xlNo
UserForm1.uniqueNameList.RowSource = Selection.CurrentRegion.Address
'Display user form.
UserForm1.Show
Selection.CurrentRegion.Clear
End Function
EDIT: I basically need to say something like this: populate second combobox with cells of the second row where the first row is equal to combobox1.
ComboBox_Change
event? – chris neilsen