Following Function give Run-time Error 424 Object needed in the line:LookupValue = Application.Caller.Offset(1, -1).Value.
Somebody knows what's wrong?
Formula gives back #value!. What I try to do is this: eg. when I insert the function in cel F4, the function matches the value in E5 with matrix.
Code:
Function LookOneBack() As Long
Dim LookupValue As Variant
Dim rngMatrix As Range
Application.Volatile
LookupValue = Application.Caller.Offset(1, -1).Value
Set rngMatrix = ThisWorkbook.Worksheets(1).Range("B1:B4")
If rngMatrix.Find(What:=LookupValue, _
LookIn:=xlValues, _
LookAt:=xlWhole, _
MatchCase:=False) Is Nothing Then
LookOneBack = 0
Else
LookOneBack = 2
End If
Set rngMatrix = Nothing
End Function