combo box?

zabiullakhan

Active Member
Joined
Aug 30, 2010
Messages
310
I have 2 combo box and i want to change the input range of the second combo box with refrence to the value in first combo box.

For example

combo box 1 - "animals", "flowers"
combo box 2 - "dog", "cat", "lion", "rose", "lily", "lotus"

if i select "animals" in combo box 1 then combo box 2 should list only "dog", "cat", "lion"

if i select "flowers" in combo box 1 then combo box 2 should list only "rose", "lily", "lotus"

Please help
 

Excel Facts

Can you AutoAverage in Excel?
There is a drop-down next to the AutoSum symbol. Open the drop-down to choose AVERAGE, COUNT, MAX, or MIN
try
Code:
[FONT=Courier New]If ActiveSheet.ComboBox1.Value = "Flower" Then[/FONT]
[FONT=Courier New]ActiveSheet.ComboBox2.ListFillRange = Range("B1:B10") ' flower range[/FONT]
[FONT=Courier New]ElseIf ActiveSheet.ComboBox1.Value = "Fruits" Then[/FONT]
[FONT=Courier New]ActiveSheet.ComboBox2.ListFillRange = Range("A1:A10") 'fruits range[/FONT]
[FONT=Courier New]Else[/FONT]
[FONT=Courier New]End If[/FONT]
 
Upvote 0
can you please paste the full function..

and i am using cobobox(from controls) as am not use to working on cobobox(activeX controls).

Please help
 
Upvote 0
i have this code to populate ComboBox2 with refrence to ComboBox1, however this ComboBox2 is not geting updated. please help

Code:
Private Sub ComboBox1_Change()
    If ActiveSheet.ComboBox1.Value = "animals" Then
        ActiveSheet.ComboBox2.ListFillRange = Range("Reference!B2:B7")      
    ElseIf ActiveSheet.ComboBox1.Value = "flowers" Then
        ActiveSheet.ComboBox2.ListFillRange = Range("Reference!B8:B14") 
    ElseIf ActiveSheet.ComboBox1.Value = "colors" Then
       ActiveSheet.ComboBox2.ListFillRange = Range("Reference!A14:A15")  
    End If
End Sub
 
Upvote 0

Forum statistics

Threads
1,224,616
Messages
6,179,908
Members
452,949
Latest member
beartooth91

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