RuggerBiker
New Member
- Joined
- Aug 5, 2021
- Messages
- 4
- Office Version
- 365
- 2019
- Platform
- Windows
- MacOS
- Mobile
- Web
I found this code posted here in 2014. I got it to work, sort of. But it doesn't run automatically when opening the document. Macros are enabled, and it's a trusted document. I have to open the Visual Basic Editor and start it. Perhaps something has changed since 2014.
Since it's so old, I've made a new post.
Since it's so old, I've made a new post.
Time Pop-Up after every 10 min
Hello Everyone, I need your help to create a pop-up in excel which will appear after every 10 min and 10 min should be variable (like any cell value where I’ll mention any time). Even if I am working on different application, excel should pop-up . Time should start on my click and it should...
www.mrexcel.com
VBA Code:
Public RunWhen As Double
Public Const cRunIntervalSeconds = 10 ' <------- This number represents 10 seconds. Change to 600 for 10 minutes
Public Const cRunWhat = "Timer" ' the name of the procedure to run
Sub StartTimer()
RunWhen = Now + TimeSerial(0, 0, cRunIntervalSeconds)
Application.OnTime EarliestTime:=RunWhen, Procedure:=cRunWhat, _
Schedule:=True
End Sub
Sub Timer()
MsgBox "10 seconds has elapsed", , "Time is up" ' Change 10 seconds to whatever you want that matches the time set in line 2
StartTimer ' Reschedules/Resets the procedure to run again and again
End Sub