Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
startdt = CDate("01-" & Format(Date1, "mmm-yyyy"))
enddt = CDate("01-" & Format(startdt + 31, "mmm-yyyy")) - 1
Sub test()
Dim Date1 As Date
Dim startdt As Date
Dim Enddt As Date
Date1 = "12/24/04"
startdt = DateSerial(Year(Date1), Month(Date1), 1)
Enddt = DateSerial(Year(startdt + 45), _
Month(startdt + 45), 1) - 1
MsgBox startdt & " " & Enddt
End Sub
Sub test2()
MsgBox MonthBegin("12/24/04")
MsgBox MonthEnd("12/24/04")
End Sub
Function MonthBegin(ADate As Date) As Date
MonthBegin = DateSerial(Year(ADate), Month(ADate), 1)
End Function
Function MonthEnd(ADate As Date) As Date
MonthEnd = DateSerial(Year(MonthBegin(ADate) + 45), _
Month(MonthBegin(ADate) + 45), 1) - 1
End Function
[blue]MonthEnd = DateSerial(Year(ADate), Month(ADate) + 1, 0)[/blue]
[blue]EoMonth(ADate, 0)[/blue]