We help IT Professionals succeed at work.

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

Gary Croxford
on
6,881 Views
Last Modified: 2017-03-14
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))
Comment
Watch Question

ShumsManaging Director/Excel VBA Developer
CERTIFIED EXPERT
Distinguished Expert 2018

Commented:
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

CERTIFIED EXPERT
Top Expert 2016
Commented:
This problem has been solved!
(Unlock this solution with a 7-day Free Trial)
UNLOCK SOLUTION
CERTIFIED EXPERT

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

Open in new window

use
Application.VLookup

Open in new window

Gary CroxfordOperations Support Analyst

Author

Commented:
Great, thank you for your help