Code:
[COLOR=#000000][FONT='inherit']ws2.Range("D3").Value = Application.WorksheetFunction.Match(variable_i, ws2.Range("A:A"), 0)[/FONT][/COLOR]
ws1 = worksheet 1 ws2 = worksheet 2
- On ws1 I have 2 columns of drop down boxes (data validation list)
- the selection from the first column of drop down boxes is assigned to the variable "variable_i"
- the selection from the second column of drop down boxes is assigned to the variable "variable_p"
- It pulls its data from ws2 (the range is all of column a)
- It is looking for the selection from the drop down box with the variable "variable_i"... the code works fine, it returns the number row on D3 without any issues
- I'm looking for it to return the row number that contains both variables in the 2 columns (variable_i and variable_p)
Code:
[COLOR=#000000][FONT='inherit']ws2.Range("D3").Value = Application.WorksheetFunction.Match(variable_i & variable_p, ws2.Range("A:B"), 0)[/FONT][/COLOR]
as I had seen that online, but it doesn't work for me.
The error I get is: "Run-time error '1004': Method 'Match' of object 'WorksheetFunction' failed
What would be the best way to have multiple variables be the lookup?
I've read I need to use Evaluate but I can't get my head around how it works
Any help would be much appreciated!