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

Create a Pivot Table on a Map
If your data has zip codes, postal codes, or city names, select the data and use Insert, 3D Map. (Found to right of chart icons).
For a 1 second delay

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

Forum statistics

Threads
1,214,590
Messages
6,120,421
Members
448,961
Latest member
nzskater

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