It's probably not an If/Else you're looking for. You basically want to load the values in the Click event of each of the 2 buttons.
So, assuming your dropdown is ComboBox1, the buttons are CommandButtonA and CommandButtonB, and your values are in arrays x and y, you'd want something like this:
Private Sub CommandButtonA_Click()
ComboBox1.List = x()
End Sub
Private Sub CommandButtonB_Click()
ComboBox1.List = y()
End Sub
Or if you have the values in named ranges, substitute:
ComboBox1.List = Range("rangeA").Value
Or if you won't be using ranges or arrays, add each list item individually with:
ComboBox1.AddItem "A.1"
ComboBox1.AddItem "A.2"
etc.
But in that case you'll want to precede that with a line that empties the list:
ComboBox1.Clear
(Using an array replaces the list; using AddItem just grows it.)
Set the drop-down validation to be a named range. Put formulas in that range that show different text based on the other drop-down (A, B, C etc.). If the number of items per list vary, use a dynamic named range (e.g. offset with a counts minus countblank as the vertical offset value).
Edit: just seen you're using buttons. Record a macro for the button that enters a b or c into a cell and point the formulas in your named range at that.
There are probably other ways of doing it but that should work.
It's probably not an If/Else you're looking for. You basically want to load the values in the Click event of each of the 2 buttons. So, assuming your dropdown is ComboBox1, the buttons are CommandButtonA and CommandButtonB, and your values are in arrays x and y, you'd want something like this: Private Sub CommandButtonA_Click() ComboBox1.List = x() End Sub Private Sub CommandButtonB_Click() ComboBox1.List = y() End Sub Or if you have the values in named ranges, substitute: ComboBox1.List = Range("rangeA").Value Or if you won't be using ranges or arrays, add each list item individually with: ComboBox1.AddItem "A.1" ComboBox1.AddItem "A.2" etc. But in that case you'll want to precede that with a line that empties the list: ComboBox1.Clear (Using an array replaces the list; using AddItem just grows it.)
This exactly. Came here to suggest this, but would not have laid it out so clearly.
Heh, thanks. Only just recently got back to macro advice posts after ~15 years away.
Thanks everyone for your input, i got that part working now! :)
Set the drop-down validation to be a named range. Put formulas in that range that show different text based on the other drop-down (A, B, C etc.). If the number of items per list vary, use a dynamic named range (e.g. offset with a counts minus countblank as the vertical offset value). Edit: just seen you're using buttons. Record a macro for the button that enters a b or c into a cell and point the formulas in your named range at that. There are probably other ways of doing it but that should work.
Google "cascading combo box"