Timer to pause code

Damo10

Active Member
Joined
Dec 13, 2010
Messages
460
Hi,

I would like some code that I can put in my current code that will have a timer or a loop of some kind that will effectivly pause the code until the time has elapsed, I would like to pause my code for 2 seconds before it continues.

Any help would be greatfull
 

Excel Facts

Excel Can Read to You
Customize Quick Access Toolbar. From All Commands, add Speak Cells or Speak Cells on Enter to QAT. Select cells. Press Speak Cells.
Hi,

Thanks that works great, can i also change this so it will pause for half a second?

Regards
 
Upvote 0
Not sure using wait this looks close, tested with a time like 10 sec.
Application.Wait Now + TimeValue("00:00:01") / 2

If not you could use this
Dim i As Single
i = Timer
While Timer - i < 0.5
Wend
'your code here
 
Upvote 0

Forum statistics

Threads
1,224,613
Messages
6,179,894
Members
452,948
Latest member
Dupuhini

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