I am tring to develop a day of week calculation function to identify the day of the week. I am getting a compile error Argument not optional. Any help would be appreciated.
Code:
Sub Last_Monday(vDate As Date)
'if today is Monday, then return today's date
If Weekday(vDate, vbSunday) = 2 Then
Last_Monday = vDate
Else
Last_Monday = vDate - Weekday(vDate, vbSunday) + 2
End If
End Sub