NUMBEROFDAYS

Returns the number of days in a month and/or year.


Remarks

* For instructions on how to add a function to a workbook refer to the page under Inserting Functions
* The equivalent JavaScript function is NUMBEROFDAYS



NUMBEROFDAYS_INAMONTH

Returns the number of days in a month.

Public Function NUMBEROFDAYS_INAMONTH(ByVal iMonthNumber As Integer, _ 
                                      ByVal iYear As Integer) As Integer
   NUMBEROFDAYS_INAMONTH = VBA.Day(VBA.DateSerial(iYear, iMonthNumber + 1, 1) - 1)
End Function


NUMBEROFDAYS_INAYEAR

Returns the number of days in a particular year.


Public Function NUMBEROFDAYS_INAYEAR(ByVal iYear As Integer) As Integer 
   NUMBEROFDAYS_INAYEAR = VBA.DateSerial(iYear + 1, 1, 1) - VBA.DateSerial(iYear, 1, 1)
End Function




© 2022 Better Solutions Limited. All Rights Reserved. © 2022 Better Solutions Limited TopPrevNext