Ok, so here's the macro that I have:
I have 2 problems with that macro:
1-The macro never show the "Time out" message box at the end of the count down. I need the countdown to last 30 minutes, but it seems that whatever time value I put, it doesn't count in real time.
2-While the macro is running, I cannot go in other workbooks, because the macro doesn't find sheet "Reg". However, I need to be able to switch between workbooks when the macro is running. I think the best way to do that is to put the 3 macros together... But I don't know how.
Thank you!!!
Code:
Sub DisableTimer()
On Error Resume Next
Application.OnTime EarliestTime:=CountDown, Procedure:="Reset", Schedule:=False
End Sub
Sub Reset()
Dim count As Long
Dim sheet As Worksheet
'Set sheet = Sheets("Reg")
count = 2
count = count - 1
If count <= 0 Then
sheet.Protect DrawingObjects:=False, Contents:=True, Scenarios:= _
False
MsgBox "Time out."
Exit Sub
End If
Call Timer
End Sub
Sub timer2()
Dim sheet As Worksheet
Dim CountDown As Date
CountDown = Now + TimeValue("00:00:01")
Set sheet = Sheets("Reg")
Application.OnTime CountDown, "Reset"
End Sub
I have 2 problems with that macro:
1-The macro never show the "Time out" message box at the end of the count down. I need the countdown to last 30 minutes, but it seems that whatever time value I put, it doesn't count in real time.
2-While the macro is running, I cannot go in other workbooks, because the macro doesn't find sheet "Reg". However, I need to be able to switch between workbooks when the macro is running. I think the best way to do that is to put the 3 macros together... But I don't know how.
Thank you!!!