I was bored, so I coded this function to find the amount of days in a month.
VB Code:
Public Function DaysInMonth(Month As Integer, Year As Long) As Integer Select Case Month% Case Is = 1 DaysInMonth% = 31 Case Is = 2 If (Year& Mod 4) = 0 Then DaysInMonth% = 29 Else: DaysInMonth% = 28 End If Case Is = 3 DaysInMonth% = 31 Case Is = 4 DaysInMonth% = 30 Case Is = 5 DaysInMonth% = 31 Case Is = 6 DaysInMonth% = 30 Case Is = 7 DaysInMonth% = 31 Case Is = 8 DaysInMonth% = 31 Case Is = 9 DaysInMonth% = 30 Case Is = 10 DaysInMonth% = 31 Case Is = 11 DaysInMonth% = 30 Case Is = 12 DaysInMonth% = 31 Case Else: DaysInMonth% = 0 End Select End Function
Enjoy,
Sir Loin




Reply With Quote