'[COLOR=#008080][I]these variables must be placed above all procedures[/I][/COLOR]
Public TimeCheck
Const WaitSecs = [COLOR=#ff0000]10[/COLOR]
Const SecondsPerDay = 86400
Sub WaitAgain()
Dim AlertTime, TimeStr As String
TimeStr = "00:00:" & Format(WaitSecs, "00")
AlertTime = Now + TimeValue(TimeStr)
Application.OnTime AlertTime, "CheckTime"
End Sub
Sub CheckTime()
Select Case (Now - TimeCheck) * SecondsPerDay
Case Is > WaitSecs: ActiveSheet.Protect Password:="[COLOR=#ff0000]password[/COLOR]"
Case Else: WaitAgain
End Select
End Sub