tiredofit
Well-known Member
- Joined
- Apr 11, 2013
- Messages
- 1,832
- Office Version
- 365
- 2019
- Platform
- Windows
Can someone tell me if this works in VBA?
specifically:
I've tried it like this:
but I get an error:
Thanks
Code:
https://trumpexcel.com/index-match/#Example-4-Lookup-Value-From-Multiple-ColumnCriteria
specifically:
Code:
=INDEX($C$2:$C$11,MATCH($E$3&"|"&$F$3,$A$2:A11&"|"&$B$2:$B$11,0))
I've tried it like this:
Code:
Dim Output
For Cols = 1 To 10
For Rows = 1 To 20
Output = Application.WorksheetFunction.Index(OutputRng, _
Application.WorksheetFunction.Match(Sheet1.Cells(Rows, 1).Value & "|" & _
Sheet1.Cells(Rows, 2).Value & "|" & _
Sheet1.Cells(Rows, Cols).Value & "|" & _
Sheet1.Cells(2, Cols).Value, _
Crit1Rng & "|" & _
Crit2Rng & "|" & _
Crit3Rng & "|" & _
Crit4Rng, _
0))
Next Rows
Next Cols
but I get an error:
Code:
Run-time '13':
Type mismatch
Thanks