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

VBA

Avatar of undefined
Last Comment
Fabrice Lambert

8/22/2022 - Mon
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
Fabrice Lambert

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
All of life is about relationships, and EE has made a viirtual community a real community. It lifts everyone's boat
William Peck