Excel: Using the WAIT() Macro Function

Last reviewed: November 2, 1994
Article ID: Q46519

SUMMARY

The WAIT() macro function in Microsoft Excel suspends the execution of a macro, allowing you to introduce a pause or delay. The WAIT() function takes an argument in the form of a serial number. The macro resumes execution at the time specified by the serial number.

The following is a method for specifying a pause:

  1. Calculate the duration of the desired pause in serial number form, that is, as a decimal fraction of one day, as in the following example:

       Time Interval        Serial Number Form
       -------------        ------------------
    
        1 day               1
        1 hour              1/24 = 0.04166667
        1 minute            1/(24*60) = 0.00069444
        1 second            1/(24*60*60) = 0.000011574
       10 seconds           10/(24*60*60) = 0.00011574
    
    

  2. Add that time to the present time by entering the WAIT() function, as follows:

          =WAIT(NOW()+0.00011574)
    

    You also can combine the steps in one statement, as in the following example:

          =WAIT(NOW()+10/(24*60*60)
    

    Both of these macro statements pause the macro for 10 seconds and then resume.


KBCategory: kbother
KBSubcategory:

Additional reference words: 1.00 1.03 1.04 1.06 1.50 2.20


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: November 2, 1994
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.