vba set delay

Noz2k

Well-known Member
Joined
Mar 15, 2011
Messages
688
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.
 

Some videos you may like

Excel Facts

How to calculate loan payments in Excel?
Use the PMT function: =PMT(5%/12,60,-25000) is for a $25,000 loan, 5% annual interest, 60 month loan.

VoG

Legend
Joined
Jun 19, 2002
Messages
63,650
For a 1 second delay

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

Watch MrExcel Video

Forum statistics

Threads
1,123,125
Messages
5,599,850
Members
414,342
Latest member
K Darrell Smith

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
Top