Results 1 to 4 of 4
  1. #1
    New Lounger
    Join Date
    Jan 2001
    Location
    Australia
    Posts
    14
    Thanks
    0
    Thanked 0 Times in 0 Posts

    How to run a macro at a specific time tomorrow (Excel 97)

    How can I set a macro to run at a specific time tomorrow using .OnTime?

    Ron

  2. #2
    3 Star Lounger
    Join Date
    Feb 2003
    Posts
    363
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: How to run a macro at a specific time tomorrow (Excel 97)

    You might want to play with something like the following;

    In cell A1 type 9/16/2004 11:18:35 PM or something like =Now()+1 'Adjust to the date and time you want the macro to run

    In the Workbook_Open event try the following
    Application.OnTime EarliestTime:=Range("A1"), _
    Procedure:="my_Procedure"



    Paul

  3. #3
    WS Lounge VIP sdckapr's Avatar
    Join Date
    Jul 2002
    Location
    Pittsburgh, Pennsylvania, USA
    Posts
    11,225
    Thanks
    14
    Thanked 342 Times in 335 Posts

    Re: How to run a macro at a specific time tomorrow (Excel 97)

    Note that using ontime will require that excel is running.

    You might also lok at using something like Windows Scheduler to open a file in excel and have the macro run from the workbook open event.

    Steve

  4. #4
    Uranium Lounger
    Join Date
    Jan 2001
    Location
    South Carolina, USA
    Posts
    7,295
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: How to run a macro at a specific time tomorrow (Excel 97)

    To run MyProc tomorrow at 1:00:00 PM, use the following:

    <pre> OnTime Date + 1 + TimeValue("1:00:00 PM"), MyProc
    </pre>


    Remember that Excel must remain active until that time.
    Legare Coleman

Posting Permissions

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