Please read forum rules below. I've moved this thread to programming.
Maybe the below will help
Place this in a normal module
Dim DownTime As Date
Sub SetTime()
DownTime = Now + TimeValue("00:05:00")
Application.OnTime DownTime, "YourMessage"
End Sub
Sub YourMessage()
MsgBox "Your worksheet is Idle for 5 minutes"
Call SetTime
End Sub
Sub Disable()
On Error Resume Next
Application.OnTime EarliestTime:=DownTime, Procedure:="YourMessage", _
Schedule:=False
End Sub
and this in Thisworkbook module
Private Sub Workbook_Open()
Call SetTime
End Sub
Private Sub Workbook_BeforeClose(Cancel As Boolean)
Call Disable
End Sub
Private Sub Workbook_SheetCalculate(ByVal Sh As Object)
Call Disable
Call SetTime
End Sub
Private Sub Workbook_SheetSelectionChange(ByVal Sh As Object, ByVal Target _
As Excel.Range)
Call Disable
Call SetTime
End Sub
VBA Noob
Bookmarks