Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations waross on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Range("A12").Value = Application.HLookup(1, "H12:EZ12", 1, T

Status
Not open for further replies.

mmartens

Mechanical
Jul 17, 2001
24
CA
I am in VB and trying to run the following using the excel function hlookup

Range("A12").Value = Application.HLookup(1, "H12:EZ12", 1, True)

but my out put is

Range("A12").Value = error 2015

can any one see what is wrong. I am at the end on my rope I am not sure what to try

thanks
 
Replies continue below

Recommended for you

The second argument of HLOOKUP must be a range, not a string variable, so:
Range("A12").Value = Application.HLookup(1, Range("H12:M12"), 1, True)

Cheers,
Joerd

Please see FAQ731-376 for tips on how to make the best use of Eng-Tips.
 
hlookup is a worksheet function, try:
Range("A12").Value = Application.worksheetfuntion.HLookup(1, Range("H12:M12"), 1, True)

Cheers
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top