Can't get HLookup to work in VBA

  • Thread starter Thread starter DFStoneJr
  • Start date Start date
D

DFStoneJr

I can't get this expression

Application.WorksheetFunction.Hlookup(today(),range("$C$4:$AA$38"),
35, False)

to work in VBA. I keep getting a 1004 message.

So I've been reduced to the very inelegant method of using this
formula

Range("C1").Formula = "=hlookup(today(),$C$4:$AA$38, 35, False)"

to insert the formula in a cell, then using the Range.Value method to
extract the formula's results.

Any help in getting the first expression to work would be greatly
appreciated, as it's been driving me nuts for most of the afternoon.

TIA.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top