Following Function give Run-time Error 424 Object needed in the line:LookupValue = Application.Caller.Offset(0, -1).Value.
Where do I use a wrong data type?
Formula gives back only "0", nomather if the statement is true or false.
VB Code:
Function LookOneBack() As Long Dim LookupValue As Variant Dim rngMatrix As Range Application.Volatile LookupValue = Application.Caller.Offset(0, -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




Reply With Quote