VBA to Pause or Wait 10 seconds before continuing code

I

Ian47

Please would someone help me with a line of code to pause or wait 10 seconds
before continuing with the remaining code.

I have tried large For...Next loops but these seem to execute too quickly!

Thanks

Ian
 
A

Austin Myers

You will need to call the timer function for this.


Private Sub (KillSomeTime)

Dim PauseTime, Start
PauseTime = 10 ' Set duration in seconds
Start = Timer ' Set start time.
Do While Timer < Start + PauseTime
DoEvents ' Yield to other processes.
Loop

End Sub

Austin Myers
MS PowerPoint MVP Team

Provider of PFCPro, PFCMedia and PFCExpress
www.playsforcertain.com
 
Top