Application.wait not working as expected

Sufiyan97

Well-known Member
Joined
Apr 12, 2019
Messages
1,614
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

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.
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,224,823
Messages
6,181,178
Members
453,021
Latest member
Justyna P

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