I am trying to create a code so that the software when let open by an employee it will close on its own.
It works great except if someone actually clicked into a cell then the timer doesnt start as it is showing as active. Problem we have is that one is working and leaves at the end of shift and then next one can’t do anything unless that person comes back and closes it.
Tried many things and I have ideas but not sure how to code it... here is what I got
I was thinking to make a timer at worst that no matter what after 12 minutes the codes send to cell a1 automatically just before that timer example
sub jumpnext ()
range ("A1").select
End Sub
but still need timer that will start weather a cell is selected or not
It works great except if someone actually clicked into a cell then the timer doesnt start as it is showing as active. Problem we have is that one is working and leaves at the end of shift and then next one can’t do anything unless that person comes back and closes it.
Tried many things and I have ideas but not sure how to code it... here is what I got
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | Dim CloseTime As Date Sub TimeSetting() CloseTime = Now + TimeValue("00:00:45") On Error Resume Next Application.OnTime EarliestTime:=CloseTime, _ Procedure:="SavedAndClose", Schedule:=True End Sub Sub TimeStop() On Error Resume Next Application.OnTime EarliestTime:=CloseTime, _ Procedure:="SavedAndClose", Schedule:=False End Sub Sub SavedAndClose() ActiveWorkbook.Close Savechanges:=True End Sub |
I was thinking to make a timer at worst that no matter what after 12 minutes the codes send to cell a1 automatically just before that timer example
sub jumpnext ()
range ("A1").select
End Sub
but still need timer that will start weather a cell is selected or not