Public Function basEOM(TheDate As Date)
Dim dtmNextMonth As Date
dtmNextMonth = VBA.DateAdd("m", 1, TheDate)
'
'By subtracting all of the days out of dtmNextMonth
'for a given date (TheDate), the last day of the previous
'month is returned by the DateValue method
'of the VBA object.
'
basEOM = VBA.DateValue(dtmNextMonth - _
VBA.DatePart("d", dtmNextMonth))
End Function
Public Function basSOM(TheDate As Date) ' 'By subtracting all of the days out of TheDate 'and adding one, the first day of the month for TheDate 'is returned by the DateValue method of the VBA object. ' basSOM = VBA.DateValue(TheDate - _ DatePart("d", TheDate) + 1)
End Function