Using the Excel VBA Wait command
Request a callback

We'll call during UK business hours

Name:
Number:
0207 987 3777

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:

Excel VBA: how to use the "Wait" command

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

 



MS Project training
Course rating:
4.8 stars - based on 5149 reviews
Microsoft Certified Partner Institute of Leadership and Management - Certified Courses Learning and Performance Institute - Accredited Training Provider Security Seal verified by visa, mastercard securecard

Connect with us: Facebook · Twitter · Google+ · LinkedIn · Pinterest