• 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.

Reminder Macro

the below will display a msgbox every 2 minutes after the workbook is opened


In ThisWorkbook:

[pre]
Code:
Private Sub Workbook_Open()

'Call CheckAlerts in 2 minutes
Application.OnTime Now + TimeValue("00:02:00"), "MyAlert"

End Sub

in new module

Sub myalert()

MsgBox "this is an alert"
End Sub
[/pre]
 
@ Dave!


Your code is fine.. if we need to run ONCE the subroutine myalert

However to repeat the same subroutine / to call every 2 minutes.. it will not work..


I think.. you need to change the above as

[pre]
Code:
Private Sub Workbook_Open()
MyAlert
End Sub
and in NewModule you need to call it as recursive..


Sub myalert()
MsgBox "this is an alert"
Application.OnTime Now + TimeValue("00:02:00"), "MyAlert"
End Sub
[/pre]
Regards,

Deb
 
A note of warning, the OnTime method stores this call in the Application. So, even if you close this workbook, but have XL still open, after 2 minutes it will open the workbook back up and run the macro. =O

If you need to stop it, might check out the examples here:

http://www.cpearson.com/excel/OnTime.aspx
 
Thank you for the code, I am sorry to say that iam very poor in macro, i tried copying it and pasted in a new module and it's not working. Can you guide me pls?
 
Hi,


I need to set a time in one column with seconds and macro should remind every two minutes from that time and this should stop me doing my regular work, so that i can do my reminder note.


Thanks in advance!
 
Hi, prasoo!


The first procedure:

-----

[pre]
Code:
Private Sub Workbook_Open()
MyAlert
End Sub
-----

goes in the ThisWorkbook section.


The second procedure:

-----

Sub myalert()
MsgBox "this is an alert"
Application.OnTime Now + TimeValue("00:02:00"), "MyAlert"
End Sub
[/pre]
-----

goes in any module.


Give a look at this file:

https://dl.dropboxusercontent.com/u/60558749/Reminder%20Macro%20%28from%20Debraj%20Roy%20for%20prasoo%20at%20chandoo.org%29.xlsm


Regards!
 
I am curious as to what is it that needs to be reminded every two minutes. If it is some kind of checking then it'd be better to check if the process that needs to be reminded itself can be automated.


e.g. every two minutes you need to download some update or check a folder then it will be better to create a procedure which takes care of it instead of getting reminded to check it.
 
@shrivallabha

Hi!

I wondered something alike, my first instinct was posting "... and attach a post it to the display upper left corner that says 'remember kill the developer asap'", but I could resist the temptation. I'm becoming more spiritually strong, am I not?

Regards!
 
Back
Top