PDA

View Full Version : Select Listbox Item by ComboBox Item



atadaliran
12-09-2017, 01:57 AM
Hi
I have 3 dependent combobox and one listbox in UserForm.


Combobox item loaded from sheet.


I want When select comboboxs items , automatically select listbox items by combobox value(for any combobox items)


for example:
when I want select in combobox1 value "a"
and combobox2 value "b"
and combobox3 value "c"
Then>Find and select automaticly this value on listbox > Row 8 in listbox selected(just example)

Kenneth Hobs
12-09-2017, 11:51 AM
Welcome to the forum!


Private Sub TextBox7_Change()
Dim i As Long
With ListBox2
For i = 0 To .ListCount - 1
If .Column(2, i) = TextBox5.Text And .Column(3, i) = TextBox6.Text _
And .Column(4, i) = TextBox7.Text Then
.ListIndex = i
Exit Sub
End If
Next i
End With
End Sub

atadaliran
12-09-2017, 10:47 PM
tanx worked prefectlyyyyyyyy:rofl:

macropod
12-10-2017, 01:03 PM
Cross-posted at:
https://www.mrexcel.com/forum/excel-questions/1034032-select-listbox-item-combobox-item.html
https://www.excelforum.com/excel-programming-vba-macros/1211293-select-listbox-item-by-combobox-item.html

Kindly read VBA Express' policy on Cross-Posting in item 3 of the rules: http://www.vbaexpress.com/forum/faq.php?faq=new_faq_item#faq_new_faq_item3