ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Can't get HLookup to work in VBA (https://www.excelbanter.com/excel-programming/317026-cant-get-hlookup-work-vba.html)

DFStoneJr

Can't get HLookup to work in VBA
 
I can't get this expression

Application.WorksheetFunction.Hlookup(today(),rang e("$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.

Frank Kabel

Can't get HLookup to work in VBA
 
Hi
try:
Application.WorksheetFunction.Hlookup(date,range(" $C$4:$AA$38"),
35, False)



--
Regards
Frank Kabel
Frankfurt, Germany

"DFStoneJr" schrieb im Newsbeitrag
om...
I can't get this expression

Application.WorksheetFunction.Hlookup(today(),rang e("$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.




All times are GMT +1. The time now is 10:41 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com