I'm having trouble with using index/match with 2 criteria in VBA.
On the workbook it's simply:
{=MATCH(criteria1&criteria2,A2:A1001&B2:B1001,0)
In VBA I have (to be done with a sheet called 'Market Data')
tomatch = Application.WorksheetFunction.Match(criteria1 & criteria2, Sheets("Market Data").Range("A2:A1001") & Sheets("Market Data").Range("B2:B1001"), 0)
price = Evaluate(tomatch)
But this gives me a #VALUE error. I've also tried putting the entire first line in quotes, as I've seen in some other posts, but then I get a "compile error: expected end of statement". Everything is dimmed as a variant.
Any help would be appreciated.
On the workbook it's simply:
{=MATCH(criteria1&criteria2,A2:A1001&B2:B1001,0)
In VBA I have (to be done with a sheet called 'Market Data')
tomatch = Application.WorksheetFunction.Match(criteria1 & criteria2, Sheets("Market Data").Range("A2:A1001") & Sheets("Market Data").Range("B2:B1001"), 0)
price = Evaluate(tomatch)
But this gives me a #VALUE error. I've also tried putting the entire first line in quotes, as I've seen in some other posts, but then I get a "compile error: expected end of statement". Everything is dimmed as a variant.
Any help would be appreciated.