Results 1 to 3 of 3

Thread: [RESOLVED] Run-time Error 424 "Object needed" is bugging me

Threaded View

  1. #1

    Thread Starter
    Member
    Join Date
    Feb 2006
    Location
    Holland
    Posts
    34

    Resolved [RESOLVED] Run-time Error 424 "Object needed" is bugging me

    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:
    1. Function LookOneBack() As Long
    2. Dim LookupValue As Variant
    3. Dim rngMatrix As Range
    4.  
    5.         Application.Volatile
    6.        
    7.         LookupValue = Application.Caller.Offset(0, -1).Value
    8.         Set rngMatrix = ThisWorkbook.Worksheets(1).Range("B1:B4")
    9.        
    10.         If rngMatrix.Find(What:=LookupValue, _
    11.                             LookIn:=xlValues, _
    12.                             LookAt:=xlWhole, _
    13.                             MatchCase:=False) Is Nothing Then
    14.             LookOneBack = 0
    15.         Else
    16.             LookOneBack = 2
    17.         End If
    18.        
    19.         Set rngMatrix = Nothing
    20. End Function
    Last edited by Tobian; Feb 21st, 2006 at 06:31 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width