COMBO BOX list changes depending on another combo box

SQUIDD

Well-known Member
Joined
Jan 2, 2009
Messages
2,126
Office Version
  1. 2019
  2. 2016
Platform
  1. Windows
Hi All

Before i get to involved with mu approach.
Is this even possible.

In a userform i have a combo box linked to a named range in a sheet. 8 options.

I then want another combo box that displays a variable named range dependent on the previous combobox

for instance

combo box 1 has the 8 options lets call them a,b,c,d,e,f,g,h

if c is in combo box 1, combobox 2 shows the named range ALLTHEC
if d is in combo box 1, combobox 2 shows the named range ALLTHED

hope this makes sense, otherwise i need to change my entire approach.

all comments welcome, even if its not possible.

Dave
 

Excel Facts

Spell Check in Excel
Press F7 to start spell check in Excel. Be careful, by default, Excel does not check Capitalized Werds (whoops)
You should be able to do it with something like
Code:
Select Case ComboBox1.Value
    Case a
         ComboBox2.List = Range("ALLTHEA").Value
    Case b
         ComboBox2.List = Range("ALLTHEB").Value
'etc.
End Select
 
Last edited:
Upvote 0
Solution
Maybe this:
It's better if you have the named range list in combobox1, then:
Code:
Private Sub ComboBox1_Change()
ComboBox2.List = Range(ComboBox1.Value).Value
End Sub
 
Last edited:
Upvote 0
Thankyou to you both.

jason i used your method, worked perfectly.

Dave
 
Upvote 0

Forum statistics

Threads
1,223,885
Messages
6,175,187
Members
452,616
Latest member
intern444

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top