Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Problems with Hlookup
I have written a new function to add the values that I obtain from a Hlookup.
My code is Function SumRev(DateFrom, DateTo) Dim dteDate As Date Dim Total As Double Dim Revenue As Double Total = 0 Revenue = 0 For dteDate = DateFrom To DateTo Revenue = WorksheetFunction.HLookup(dteDate, Range("Revenue_Table"), 21, False) Total = Total + Revenue Next SumRev = Total End Function I keep getting a #VALUE! error. I know the error comes from the dteDate parameter in my Hlookup because when I change this to DateFrom it works. But I need to add a range of values. Can somebody help. Thanks, Danie |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
aauugghhh...#div/o problems & various average formula problems | Excel Worksheet Functions | |||
Problems with HLOOKUP and VLOOKUP | Excel Discussion (Misc queries) | |||
Problems with HLOOKUP and VLOOKUP | Excel Worksheet Functions | |||
hlookup | Excel Discussion (Misc queries) | |||
HLookUp | Excel Programming |