ISDATEFIRST

Returns whether a date is the first of a week, month or year.


Remarks

For instructions on how to add a function to a workbook refer to the page under Inserting Functions



ISDATEFIRST_OFAWEEK

Returns whether a date is the first day of the week.



ISDATEFIRST_OFAMONTH

Returns whether a date is the first day of the month.

Public Function ISDATEFIRST_OFAMONTH( _ 
Optional ByVal dtDateValue As Date) As Boolean

Dim iDay As Integer
    Application.Volatile
    
    If VBA.IsMissing(dtDateValue) Then
        dtDateValue = VBA.Date
    End If
    
    iDay = VBA.Day(dtDateValue)
    If (iDay = 1) Then ISDATEFIRST_OFAMONTH = True
    If (iDay > 1) Then ISDATEFIRST_OFAMONTH = False
End Function

ISDATEFIRST_OFAYEAR

Returns whether a date is the first day of a year.



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