×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

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

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

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

(OP)
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

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

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.

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

hlookup is a worksheet function, try:
Range("A12").Value = Application.worksheetfuntion.HLookup(1, Range("H12:M12"), 1, True)

Cheers

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources