combo Box programming

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

combo box 1
Combo box problems 1
combo box 2
Using combo box 1
Cascading Combo Box & Content Filtering 1
Combo Boxes 3
Linking Combo Box Values to Access Table 2
Populate Combo Box 6

Back
Top