Function returns True if date falls on a weekend


Description: Function returns True if date falls on a weekend

‘Public Function IsWeekend(ByVal vntDate As Variant) As Boolean
Dim bResult         As Boolean
If IsDate(vntDate) Then
If (WeekDay(vntDate) Mod 6 = 1) Then bResult = True Else bResult = False
Else
Err.Raise 13, “Type Mismatch, Must Be Date”
End If
IsWeekend = bResult
‘End Function

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s