Avatar of Gary Croxford
Gary Croxford
Flag for United Kingdom of Great Britain and Northern Ireland asked on

VBA VLOOKUP - "Run-time Error 1004: Unable to get the Vlookup property of the WorksheetFunction class."

Thank you for looking at my question,

I have read through the answers already on EE regarding and not found what I need so, simply, how do I incorporate the statement below in VBA

=IF(ISERROR(VALUE($I$2)),VLOOKUP($I$2,'O:\Materials Data\VZ Interpreter\[VZOptions.xlsx]Material'!$A$1:$C$10,3,FALSE),VLOOKUP(VALUE($I$2),'O:\Materials Data\VZ Interpreter\[VZOptions.xlsx]Material'!$A$1:$C$10,3,FALSE))
VBAMicrosoft Excel

Avatar of undefined
Last Comment
Gary Croxford

8/22/2022 - Mon
Shums Faruk

You can try as below changing activecell:
ActiveCell.FormulaR1C1 = "=IF(ISERROR(VALUE(R2C9)),VLOOKUP(R2C9,'O:\Materials Data\VZ Interpreter\[VZOptions.xlsx]Material'!R1C1:R10C3,3,FALSE),VLOOKUP(VALUE(R2C9),'O:\Materials Data\VZ Interpreter\[VZOptions.xlsx]Material'!R1C1:R10C3,3,FALSE))"

Open in new window

ASKER CERTIFIED SOLUTION
Rgonzo1971

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.
Joe Howard

If you get runtime error 1004, instead of using
WorksheetFunction.VLookup

Open in new window

use
Application.VLookup

Open in new window

Gary Croxford

ASKER
Great, thank you for your help
This is the best money I have ever spent. I cannot not tell you how many times these folks have saved my bacon. I learn so much from the contributors.
rwheeler23