Hi
Im trying to lookup two values that come from two comboboxes of a userform and the result to appear in a textbox
The values of the comboboxes are related to two different name ranges on my sheet 2 and the table array for the lookup formula is in the same sheet (sheet2)
I want that a button on the userform when clicked show me the lookup result from these two comboboxes on a texbox and if the combination ot this two comboboxes doesn´t match then send me a message that there is no match.
My first combobox has a list of products and the second a list of countries. My data has four columns the first its a help column to make the lookup the second contains a product, the third a country and the fourth a regulation that applies depending of the combination of the first and second column.
<tbody>
</tbody>
i tried with this code for the vlookup formula but the result doesnt appear
help please!!!
Im trying to lookup two values that come from two comboboxes of a userform and the result to appear in a textbox
The values of the comboboxes are related to two different name ranges on my sheet 2 and the table array for the lookup formula is in the same sheet (sheet2)
I want that a button on the userform when clicked show me the lookup result from these two comboboxes on a texbox and if the combination ot this two comboboxes doesn´t match then send me a message that there is no match.
My first combobox has a list of products and the second a list of countries. My data has four columns the first its a help column to make the lookup the second contains a product, the third a country and the fourth a regulation that applies depending of the combination of the first and second column.
helper | product | conuntry | regulartion |
tomatospain | tomato | spain | regulation 1 |
avocadoUSA | avocado | USA | regulation 3 |
blueberryjapan | blueberry | japan | regulation 9 |
<tbody>
</tbody>
Code:
Private Sub CommandButton1_click()
txtregulation = Application.WorksheetFunction.VLookup(ComboBox1.value & ComboBox2.value, Sheet1.Range("tabla"), 4, False)
i tried with this code for the vlookup formula but the result doesnt appear
help please!!!