• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

WorkBook Timer

ianb

Member
[pre]
Code:
Sub WorkbookTime()
Dim Start, Finish, TotalTime, TotalTimeInMinutes, TimeInMinutes
Application.DisplayAlerts = True
TimeInMinutes = 10 'Timer is set for x minutes; change as needed.
If TimeInMinutes > 5 Then
TotalTimeInMinutes = (TimeInMinutes * 60) - (5 * 60)
Start = Timer
Do While Timer < Start + TotalTimeInMinutes
DoEvents
Loop
Finish = Timer
TotalTime = Finish - Start
Application.DisplayAlerts = False
MsgBox "The PSO Dashboard has been open for " & TotalTime / 60 & " minutes.  You have 5 minutes to save before The Dashboard closes."
End If

Start = Timer
Do While Timer < Start + (5 * 60)
DoEvents
Loop
Finish = Timer
TotalTime = Finish - Start
Application.DisplayAlerts = False
MsgBox "Excel will now close."
Application.Quit
End Sub
[/pre]
 
Ianb


When posting a file like this can you please add:

  • A Description of what it does
  • Details on how to use it
    Please put a single ` before and after any code so that Indents are maintained
 
Do you want to remove this entry and I will readd with the criteria you have requested.


Future entries will match your criteria.
 
Back
Top