I'm trying to do a multiple criteria index match function in vba but I can't seem to get the results. The code I used is the following:
wsDest.Range(wsDest.Cells(i, X), wsDest.Cells(i, X)) = _
Application.WorksheetFunction.Index(wsSour.Range("C3:C8763"), _
Application.WorksheetFunction.Match(wsDest.Cells(i, 1) & "&" & wsDest.Cells(i, 2), _
wsSour.Range("A3:A8763") & "&" & wsSour.Range("B3:B8763"), 0), 0)
For the match portion I was trying to use excel's method of
=MATCH(criteria1 & criteria2,range1 & range2,0)
You can use the
WorkSheet.Evaluate
method to do this.Here's a simple example:
EDIT: here's a more robust example taking into account the different sheets