Application.wait not working as expected

Sufiyan97

Well-known Member
Joined
Apr 12, 2019
Messages
1,585
Office Version
  1. 365
  2. 2013
Platform
  1. Windows
I have below code, which is not working as expected.
What I want is to wait a code for 2 sec before going to another line, but when I run the code, it shows in VBA window as running and does not do anything except when I press "ESC" from keyboard, and code runs in one go without waiting for 2 sec before each line.

VBA Code:
Sub Macro1()


    Range("A1").Value = "Name"
    Application.Wait "00:00:02"
    
    Range("A2").Value = "A"
    Application.Wait "00:00:02"
    Range("A3").Value = "B"
    Application.Wait "00:00:02"
    Range("A4").Value = "C"
    Application.Wait "00:00:02"
    Range("A5").Value = "D"
    Application.Wait "00:00:02"


    Range("A1").Select
   
  
End Sub
 

Excel Facts

Bring active cell back into view
Start at A1 and select to A9999 while writing a formula, you can't see A1 anymore. Press Ctrl+Backspace to bring active cell into view.
I tried it using the following and it does what you'd expect.
- edit found shorter version

Code:
 Application.Wait (Now + TimeValue("00:00:02"))
 
Last edited:
Upvote 0

Forum statistics

Threads
1,223,887
Messages
6,175,199
Members
452,617
Latest member
Narendra Babu D

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top