ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Can I tell my Macro to stop running for 10sec? (https://www.excelbanter.com/excel-programming/359331-can-i-tell-my-macro-stop-running-10sec.html)

Gazzr[_4_]

Can I tell my Macro to stop running for 10sec?
 

Hi,

Is there anyway to tell a macro to "Pause" when it gets to a certain
stage for a set amount of time?

After the set amount of time I need it to start again!

Any ideas?
Regards
Garry


--
Gazzr
------------------------------------------------------------------------
Gazzr's Profile: http://www.excelforum.com/member.php...o&userid=31075
View this thread: http://www.excelforum.com/showthread...hreadid=534402


Edwin Tam[_7_]

Can I tell my Macro to stop running for 10sec?
 
Try this:

Sub waiting()
Application.Wait (Now + TimeValue("0:00:10"))
MsgBox "Hello"
End Sub

Or, you may also have a look at the OnTime method.

Regards,
Edwin Tam

http://www.vonixx.com


"Gazzr" wrote:


Hi,

Is there anyway to tell a macro to "Pause" when it gets to a certain
stage for a set amount of time?

After the set amount of time I need it to start again!

Any ideas?
Regards
Garry


--
Gazzr
------------------------------------------------------------------------
Gazzr's Profile: http://www.excelforum.com/member.php...o&userid=31075
View this thread: http://www.excelforum.com/showthread...hreadid=534402



Gary Keramidas

Can I tell my Macro to stop running for 10sec?
 
from the vb help file
This example runs my_Procedure 15 seconds from now.

Application.OnTime Now + TimeValue("00:00:15"), "my_Procedure"

--


Gary


"Gazzr" wrote in message
...

Hi,

Is there anyway to tell a macro to "Pause" when it gets to a certain
stage for a set amount of time?

After the set amount of time I need it to start again!

Any ideas?
Regards
Garry


--
Gazzr
------------------------------------------------------------------------
Gazzr's Profile:
http://www.excelforum.com/member.php...o&userid=31075
View this thread: http://www.excelforum.com/showthread...hreadid=534402




Gazzr[_5_]

Can I tell my Macro to stop running for 10sec?
 

They were both excellent answers. I'll make sure I check out "Help" next
time!

Thanks
Garry


--
Gazzr
------------------------------------------------------------------------
Gazzr's Profile: http://www.excelforum.com/member.php...o&userid=31075
View this thread: http://www.excelforum.com/showthread...hreadid=534402



All times are GMT +1. The time now is 01:13 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com