DAYSINAMONTH

Returns the number of days in a particular month and year.


Remarks

* For instructions on how to add a function to a workbook refer to the page under Inserting Functions
* 31 days - Jan, Mar, May, Jul, Aug, Oct, Dec
* 30 days - Apr, Jun, Sep, Nov
* 28/29 days - Feb
* The equivalent Excel formula is Number of days in a particular month
* The equivalent JavaScript function is DAYSINAMONTH


Public Function DAYSINAMONTH( _ 
         ByVal iMonthNumber As Integer, _
         ByVal iYear As Integer) As Integer

   DAYSINAMONTH = VBA.Day(VBA.DateSerial(iYear, iMonthNumber + 1, 1) - 1)
End Function


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