Link to home
Create AccountLog in
Avatar of ABINAYA MOHAN
ABINAYA MOHAN

asked on

Need help with VBA Vlook up Function (Run-time error '438' Object doesn't support this property or method)

I am using the following code to do a Vlook up and get Runtime error :438 in the If Not (Application.WorksheetFunction.IsEmpty(Application.VLookup(Application.WorksheetFunction.CONCATENATE(.Range("D2").Value, .Range("N36").Value), Garantia_Reais_rng, 7, False))) Then Line code.Pardon my Bad coding, I am fairly new to VBA.


If Not IsEmpty(.Range("D2").Value) Or IsEmpty(.Range("N36").Value) Then
       If .Range("L36").Value = "Liquid Security" Then
           If Not (Application.WorksheetFunction.IsEmpty(Application.VLookup(Application.WorksheetFunction.CONCATENATE(.Range("D2").Value, .Range("N36").Value), Garantia_Liq_rng, 7, False))) Then
           .Range("Q36").Value = Application.WorksheetFunction.VLookup(Application.WorksheetFunction.CONCATENATE(.Range("D2").Value, .Range("N36").Value), Garantia_Liq_rng, 7, False)
           Else
           .Range("Q36").Value = 0
           End If
        Else
           If Not (Application.WorksheetFunction.IsEmpty(Application.VLookup(Application.WorksheetFunction.CONCATENATE(.Range("D2").Value, .Range("N36").Value), Garantia_Reais_rng, 7, False))) Then
           .Range("Q36").Value = Application.WorksheetFunction.VLookup(Application.WorksheetFunction.CONCATENATE(.Range("D2").Value, .Range("N36").Value), Garantia_Reais_rng, 7, False)
           Else
           .Range("Q36").Value = 0
           End If
        End If
        End If

Open in new window

Avatar of Norie
Norie

You shouldn't try to do the whole thing all in one go and you should use Application.function instead of Application.WorksheetFunction.function.

As for the how to exactly fix the code, what is it you are looking up and where are you looking for it?
ASKER CERTIFIED SOLUTION
Avatar of Fabrice Lambert
Fabrice Lambert
Flag of France image

Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account