Good afternoon
These two functions will give you your required dates.
Maurice
Function StartOfWeek(D As Variant, Optional FirstWeekday As Integer) As Variant
'
' Returns the date representing the first day of the current week.
'
' Arguments:
' D = Date
' FirstWeekday = (Optional argument) Integer that represents the first
' day of the week (e.g., 1=Sun..7=Sat).
'
If IsMissing(FirstWeekday) Then 'Sunday is the assumed first day of week.
StartOfWeek = D - WeekDay(D) + 1
Else
StartOfWeek = D - WeekDay(D, FirstWeekday) + 1
End If
End Function
==========================
Function EndOfWeek(D As Variant, Optional FirstWeekday As Integer) As Variant
'
' Returns the date representing the last day of the current week.
'
' Arguments:
' D = Date
' FirstWeekday = (Optional argument) Integer that represents the first
' day of the week (e.g., 1=Sun..7=Sat).
'
If IsMissing(FirstWeekday) Then 'Sunday is the assumed first day of week.
EndOfWeek = D - WeekDay(D) + 7
Else
EndOfWeek = D - WeekDay(D, FirstWeekday) + 7
End If
End Function
Can someone give me the formula to return the first date
of the week and last date of the week from a given date.
==========================