Combo Box and List Boxa

  • Thread starter Thread starter elitemirc
  • Start date Start date
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
 
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)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top