Combo Box and List Boxa

E

elitemirc

Can someone help with the following please.

i have a worksheet with a userform and on the userform i have
combobox and a listbox.

what i want is when i select an address on a combo box it shows th
full address in the listbox.

i have all the address on sheet1 of the workboo
 
B

Bob Phillips

Assuming that the data is spread across columns, and in a named range called
myData, this should do it

Private Sub ComboBox1_Change()
ListBox1.AddItem Range("mydata")(ComboBox1.ListIndex + 1, 2).Value
ListBox1.AddItem Range("mydata")(ComboBox1.ListIndex + 1, 3).Value
ListBox1.AddItem Range("mydata")(ComboBox1.ListIndex + 1, 4).Value
ListBox1.AddItem Range("mydata")(ComboBox1.ListIndex + 1, 5).Value
End Sub


--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 
Top