VBA to Pause or Wait 10 seconds before continuing code

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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
 
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top