+ Reply to Thread
Results 1 to 8 of 8

Macro to display message every n minutes!

  1. #1
    Registered User
    Join Date
    03-30-2007
    Posts
    72

    Macro to display message every n minutes!

    I have a spreadsheet and a macro that creates a new sheet and enters some data into the sheet. The user gets to make some changes to the created sheet and then prints it out. I was wandering if there was any way to have a message coming up every 10 minutes remindnig the user about the new sheet untill it was printed out and then the warnings would stop. Could anyone sugest a good way to do that?
    Thank you in advance!
    Last edited by SER01; 06-14-2009 at 07:37 PM.

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Macro to display message every n minutes!

    See Help in the VBE for the OnTime method.
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Registered User
    Join Date
    03-30-2007
    Posts
    72

    Re: Macro to display message every n minutes!

    Thank you, your sugestion did get me in the right direction. This is the code that i have that displays the warning 4 times at 5 sec intervals. My question is how would i cancel the event before the end of the loop at the execution of a different macro

    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    03-30-2007
    Posts
    72

    Re: Macro to display message every n minutes!

    Any sugestions, anyone?

  5. #5
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Macro to display message every n minutes!

    Don't schedule it multiple times; schedule it once, and put the schedule time in a public variable.

    When the MsgBox routine pops up, have it reschedule itself for 5 minutes hence (and, again put the schedule time in the public variable).

    In the Workbook_BeforePrint event, unschedule the macro using the public variable as shown in the example in Help.

  6. #6
    Registered User
    Join Date
    03-30-2007
    Posts
    72

    Re: Macro to display message every n minutes!

    Quote Originally Posted by shg View Post
    Don't schedule it multiple times; schedule it once, and put the schedule time in a public variable.
    I'm sorry but i am very green when it comes to vba.
    How would i declare a public variable? Should the event be scheduled in a macro or somwhere else?
    Thank you!

  7. #7
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Macro to display message every n minutes!

    In a code module:
    Please Login or Register  to view this content.
    In ThisWorkbook module
    Please Login or Register  to view this content.

  8. #8
    Registered User
    Join Date
    03-30-2007
    Posts
    72

    Re: Macro to display message every n minutes!

    Thank you very much!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1