vba set delay

Noz2k

Well-known Member
Joined
Mar 15, 2011
Messages
693
I currently have a procedure set up which contains a loop that sends email alerts to different depots, based on data related on a worksheet (i.e. 1 row = 1 alert)

However when I run through this the alerts do not get delivered in the same sequence that they were sent, and the occasionally 1 is 'lost' for a little while. I've noticed that if I run the whole procedure through the debugger slowly that no emails seem to get 'lost' and they are delivered in the correct order.

So I was wondering if there was a bit of code I could put in which delays the procedure slightly during each loop to give the email before had a chance to be delivered first.
 

Excel Facts

When did Power Query debut in Excel?
Although it was an add-in in Excel 2010 & Excel 2013, Power Query became a part of Excel in 2016, in Data, Get & Transform Data.
For a 1 second delay

Code:
Application.Wait Now + TimeSerial(0, 0, 1)
 
Upvote 0

Forum statistics

Threads
1,213,495
Messages
6,113,992
Members
448,538
Latest member
alex78

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