ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Combo and List box combination (https://www.excelbanter.com/excel-programming/420530-combo-list-box-combination.html)

Atif

Combo and List box combination
 
Hi All,

Data is in following arrangement

Col A Col B
1 A B
2 A1 B1
3 A2 B2
4 A3

How can I populate a combo box with A and B (catagory), and display
corresponding values in a List Box.

galimi

Combo and List box combination
 
Atif,

You have many options. The easiest way through this would be to combine the
values into a third column and use a Form combobox with a list range. You
could also do this programatically with a control combobox and combine the
values into one column or two.
--
http://www.ExcelHelp.us

888-MY-ETHER ext. 01781474



"Atif" wrote:

Hi All,

Data is in following arrangement

Col A Col B
1 A B
2 A1 B1
3 A2 B2
4 A3

How can I populate a combo box with A and B (catagory), and display
corresponding values in a List Box.


Per Jessen

Combo and List box combination
 
Hi

It can be done like this:

Private Sub ComboBox1_Click()
If Me.ComboBox1.Value = Range("A1").Value Then
Me.ListBox1.RowSource = "A2:A4"
ElseIf Me.ComboBox1.Value = Range("B1").Value Then
Me.ListBox1.RowSource = "B2:B4"
End If

End Sub
Private Sub UserForm_Initialize()
Me.ComboBox1.AddItem Range("A1").Value
Me.ComboBox1.AddItem Range("B1").Value
End Sub

Regards,
Per


"Atif" skrev i meddelelsen
...
Hi All,

Data is in following arrangement

Col A Col B
1 A B
2 A1 B1
3 A2 B2
4 A3

How can I populate a combo box with A and B (catagory), and display
corresponding values in a List Box.




All times are GMT +1. The time now is 06:08 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com