Forum home » Topics » Using the Excel VBA Wait command
Using the Excel VBA Wait command
|
The Excel VBA Wait command is an instruction that can be used to delay the running of a macro.
The command is written as:
expression.Wait(Time)
e.g. This example pauses a running macro until 6:23 P.M. today.
Application.Wait "18:23:00"
or
This example displays a message indicating whether 10 seconds have passed.
If Application.Wait(Now + TimeValue("0:00:10")) Then
MsgBox "Time expired"
End If
It can be used in a HR or Financial function to have a front splash screen(logo) and after a delay, the main form appears.
After running a routine, you may want a message box to appear outlining the next instruction.
|
Related forum posts:
I understand the command -
[b]Application.Wait Now + TimeValue("00:00:01")[/b]
is to pause the macro for 1 second before execution. But it only pauses at the beginning of the macro and not within.
How do I manipulate the line so it will pause in the middle of my macro.
e.g. My Excel macro suppose to wait for the user to choose paper tray before printing. My code so far pauses for 5 seconds at the beginning before it executes...
''''''''''''''''''''''''''''''''' Read forum post
|
|
Connect with us: Facebook
· Twitter
· Google+
· LinkedIn
· Pinterest
© 2013 Best STL. All
Rights Reserved. A Microsoft software training company. info
All prices offered for business users and exclude VAT. E&OE · Terms
& conditions · Privacy & cookie policy
Resources