Sub NumberOfDaysInMonth(month, year)
if month < 10 then
month = "0" & month
end if
return DateDay(DateAdd(DateParse(month & "/01/" & year), 0, +1, -1))
End Sub
Sub NumberOfDaysInYear(year)
return DateDayOfYear(DateAdd(DateParse("01/01/" & year), +1, 0, -1))
End Sub