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.
[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD]helper[/TD]
[TD]product[/TD]
[TD]conuntry[/TD]
[TD]regulartion[/TD]
[/TR]
[TR]
[TD]tomatospain[/TD]
[TD]tomato[/TD]
[TD]spain[/TD]
[TD]regulation 1[/TD]
[/TR]
[TR]
[TD]avocadoUSA[/TD]
[TD]avocado[/TD]
[TD]USA[/TD]
[TD]regulation 3[/TD]
[/TR]
[TR]
[TD]blueberryjapan[/TD]
[TD]blueberry[/TD]
[TD]japan[/TD]
[TD]regulation 9[/TD]
[/TR]
</tbody>[/TABLE]
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.
[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD]helper[/TD]
[TD]product[/TD]
[TD]conuntry[/TD]
[TD]regulartion[/TD]
[/TR]
[TR]
[TD]tomatospain[/TD]
[TD]tomato[/TD]
[TD]spain[/TD]
[TD]regulation 1[/TD]
[/TR]
[TR]
[TD]avocadoUSA[/TD]
[TD]avocado[/TD]
[TD]USA[/TD]
[TD]regulation 3[/TD]
[/TR]
[TR]
[TD]blueberryjapan[/TD]
[TD]blueberry[/TD]
[TD]japan[/TD]
[TD]regulation 9[/TD]
[/TR]
</tbody>[/TABLE]
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!!!