Fill textbox from cells adjacent to lookup value

MarkRCC

New Member
Joined
May 22, 2017
Messages
46
Hi All

I am making a lookup userform for Regional Ecosystem IDs.
The host spreadsheet consists of 8 columns. The first column values will be the lookup value in a combobox on the userform. I am looking for code that will fill the other 7 textboxes with the data from the adjacent columns. I am sure this is possible, but I am not very experienced with VBA.

Thanks in advance!
 

Excel Facts

Return population for a City
If you have a list of cities in A2:A100, use Data, Geography. Then =A2.Population and copy down.
Similarly, I would be interested to know how to apply the VLOOKUP formula to VBA. As an attempted method of solving the above question, i tried using a code such as this:

Code:
Private Sub cboREID_Change()
Set ws = Worksheets("Redlands Condensed")

Application.WorksheetFunction.VLookup(cboREID.Value, ws.Range("REDD"), 2, False) = txtBioS.Value


End Sub

But this did not work. Any hints on how to fix the syntax?

P.S. cbo.REID is the combo box that has the Regional Ecosystem ID values.
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,181
Members
453,022
Latest member
Mohamed Magdi Tawfiq Emam

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top