View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Leith Ross[_408_] Leith Ross[_408_] is offline
external usenet poster
 
Posts: 1
Default How can I control the macro's running time?


Hello Ming,

The Sleep API will halt all execution from millseconds to hours. Add
new VBA module to your project anad paste the following code into it.

EXAMPLE OF STOPPING FOR 1 MINUTE
Sleep(60000)

Code
-------------------

'Time is in Milliseconds. 1 millisecond = 1/1000 of a second
Public Declare Function Sleep _
Lib "kernel32.dll" _
(ByVal dwMillisecs As Long) As Long

-------------------


Sincerely,
Leith Ros

--
Leith Ros
-----------------------------------------------------------------------
Leith Ross's Profile: http://www.excelforum.com/member.php...fo&userid=1846
View this thread: http://www.excelforum.com/showthread.php?threadid=49560