FoRmEd
Board Regular
- Joined
- Jan 29, 2011
- Messages
- 72
Hello again,
I need it to display the weekending date (Saturday) and prompt the user to update on Monday at 5am.
This is what I have so far...it's missing alot I know...
I need it to display the weekending date (Saturday) and prompt the user to update on Monday at 5am.
This is what I have so far...it's missing alot I know...
Code:
Sub Worksheet_Activate()
Dim YesNo As Variant
If Range("D2").Value < Now Then
YesNo = MsgBox("Update Week Ending date?", vbYesNo + vbQuestion, "Update")
If YesNo = vbYes Then
ActiveSheet.Unprotect Password:="****"
dif = "7" - Format(Date, "w")
lstDOW = Format(Now + dif, "d mmm yyyy")
ActiveSheet.Range("D2") = CDate(lstDOW)
ActiveSheet.Protect Password:="****"
End If
End If
End Sub