ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Help with OnTIme Event Issue (https://www.excelbanter.com/excel-programming/311646-help-ontime-event-issue.html)

R

Help with OnTIme Event Issue
 
I am learning VBA using John Walkenbach's great book. I am also
frantically trying to make my project work! I need to build my Macro
so it runs every two minutes (on the minute mark) as long as the
workbook is open. I see in Walkenbach's example that I can use the
"OnTime Event" ---

Sub SetAlarm()
Application.OnTIme 0.625, "DisplayAlarm"
End Sub

Sub DisplayAlarm()
Beep
MsgBOx "Wake Up. Its time for an afternoon break"
End Sub


If I want to modify this example so DisplayAlarm beeps and gives the
mssg box every two minutes on the even second, how would I do that?

Thanks for your insights!

Chip Pearson

Help with OnTIme Event Issue
 
See www.cpearson.com/excel/ontime.htm for details and example
code.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com



"R" wrote in message
...
I am learning VBA using John Walkenbach's great book. I am also
frantically trying to make my project work! I need to build my
Macro
so it runs every two minutes (on the minute mark) as long as
the
workbook is open. I see in Walkenbach's example that I can use
the
"OnTime Event" ---

Sub SetAlarm()
Application.OnTIme 0.625, "DisplayAlarm"
End Sub

Sub DisplayAlarm()
Beep
MsgBOx "Wake Up. Its time for an afternoon break"
End Sub


If I want to modify this example so DisplayAlarm beeps and
gives the
mssg box every two minutes on the even second, how would I do
that?

Thanks for your insights!





All times are GMT +1. The time now is 10:44 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com