I am trying to build lookup function in VBA imitating formula:
=INDEX(get_column, MATCH(lookup, lookup_column,0),1)
I have cooked this:
Public Function IndexMatch(get_column As Range, lookup As Range, lookup_column As Range) As Variant
IndexMatch = Application.WorksheetFunction.Index(get_column, Application.WorksheetFunction.Match(lookup, lookup_column, 0), 1)
End Function
I keep getting a #VALUE! error.
UPDATE (following comments of KS Sheon). So this function actually works, the problem was in having VBA function in a different workbook.