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

Back into an answer in Excel
Use Data, What-If Analysis, Goal Seek to find the correct input cell value to reach a desired result
For a 1 second delay

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

Forum statistics

Threads
1,215,092
Messages
6,123,063
Members
449,090
Latest member
fragment

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