Hello
I am creating a complex formula with UDF, this Hlookup is part of my complete formula.
Meanwhile, I am working on this piece, not Sure what I am doing Wrong
I try to conver "MonthCurrent" Variable in a Year because the MonthCurrent is 06/01/2014, so will be Year(6/1/2014) = 2014
My Range called "DailyRates" is based per Year = 2014, 2015 ......
Not sure what I am doing wrong, please if somebody can help... Thanks so much.
Function Outputyear(MonthCurrent As Date) As String
Dim DailyRatesRange As Range
Set DailyRatesRange = Range("DailyRates")
WorkingYear = Application.WorksheetFunction.Year(MonthCurrent)
Outputyear = Application.WorksheetFunction.HLookup(WorkingYear, DailyRatesRange, 27, False)
End Function
Bookmarks