I know the easiest way to do a dependent drop down is with Data Validation. However, the options in my lists are too long to use this (unfortunately, I cannot make them shorter.) I need to be able to create a 2 dependent drop downs (total 3 that cascade depending on the selection.)
I was thinking I could use a combo box and the cell link function. Then I could write a code that said "If this cell is equal to 1 then use this selection on the drop down. If this cell is equal to 2 then use this selection...etc.
Problem is I don't know if this would work and I'm not very good at writing code. There might even be a better way...
Example:
Drop down 1 - select meat, veggies, fruits (say we select meat)
Drop down 2 - select chicken, pork, steak (say we select Steak)
Drop down 3 - select medium well, well, rare (we select rare)
So i used a combobox list range and input the first drop down and had in link to cell A2 then I wrote the below code for Drop down 2 but it doesn't work. Again, I'm new to this and yeah
Private Sub ComboBox2_Change()
If Range(A2) = "Fruits" Then
ComboBox2.AddItem "Apple"
ComboBox2.AddItem "Banana"
If Range(A2) = "Meat" Then
ComboBox2.AddItem "Chicken"
ComboBox2.AddItem "Steak"
End If
End Sub
Any help is MASSIVELY appreciated, I've been trying to figure this out for ages and I need this form done ASAP and this is the only thing left.
I was thinking I could use a combo box and the cell link function. Then I could write a code that said "If this cell is equal to 1 then use this selection on the drop down. If this cell is equal to 2 then use this selection...etc.
Problem is I don't know if this would work and I'm not very good at writing code. There might even be a better way...
Example:
Drop down 1 - select meat, veggies, fruits (say we select meat)
Drop down 2 - select chicken, pork, steak (say we select Steak)
Drop down 3 - select medium well, well, rare (we select rare)
So i used a combobox list range and input the first drop down and had in link to cell A2 then I wrote the below code for Drop down 2 but it doesn't work. Again, I'm new to this and yeah
Private Sub ComboBox2_Change()
If Range(A2) = "Fruits" Then
ComboBox2.AddItem "Apple"
ComboBox2.AddItem "Banana"
If Range(A2) = "Meat" Then
ComboBox2.AddItem "Chicken"
ComboBox2.AddItem "Steak"
End If
End Sub
Any help is MASSIVELY appreciated, I've been trying to figure this out for ages and I need this form done ASAP and this is the only thing left.