combo Box programming

B

brett4098

I have a Combo box list populated. What i am trying to achieve is when
select a name from the list, i can have information about that nam
populate a part of the spreadsheet. When i select a different name, i'
like the old info to disappear and the information for the next nam
appear. Any help would be much appreciated. Thanks guys, you've bee
great in the past
 
B

Bob Phillips

Brett,

Do you have a table of data where the values in the combobox is the first
column? Assuming so, and it has a name of say 'myTable', you can use VLOOKUP
in VBA to get the data

Set rng = Worksheets("Sheet1").Range("A1")
With Combobox1
rng.Value = .Value
rng.Offset(0,1).Value = Application.VLOOKUP(.Value,
Range("myTable"),2,FALSE)
rng.Offset(0,2).Value = Application.VLOOKUP(.Value,
Range("myTable"),2,FALSE)
End With

Add this code into the combobox click event.
 

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

Similar Threads

Highlight multiple items in listbox based on textbox item 1
Combo box 0
Userform dropdown doesn't go away 0
combo box 2
combo box 1
Combo box problems 1
Combo boxes in excel 6
Mail Merge query 1

Top