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