Assuming
variable d1 has the date (existing)
variable d2 has the new date entered
here's a piece of code to check
Dim i As Integer
i = DateDiff("d", DateAdd("d", -(Weekday(d1)), d1), d2)
If i < 0 Or i > 6 Then
MsgBox "Error"
End If
Too much in one line?
The idea is to get the date of the first weekday of d1 & then to check if d2 is within 7 days (0-6) of d1
I've chopped it down here
Weekday(d1)
(step 1)gets the weekday (0=sun to 7=sat)
DateAdd("d", -(step1), d1)
(step 2) gets the date of the week's beginning
DateDiff("d", step2, d2)
(step 3) gets the difference (how far is d2 from the week's beginning)
Then you check if it's within 7 days