XLA routines: EE_LastDayOfMonth

Nick's picture
EE_LastDayOfMonth takes a date and returns the last day of the month that the date is in.
Function EE_LastDayOfMonth(dt As Date) As Date
'Takes a date and returns the last day of the month
'http://excelexperts.com/xla-routines-eeLastDayOfMonth    for updates on this function
    EE_LastDayOfMonth = DateAdd("d", -1, EE_FirstDayOfMonth(DateAdd("m", 1, dt)))
End Function