Copy/Time Delay

  • Thread starter Thread starter Mike
  • Start date Start date
M

Mike

Hi,

I'm trying to write a macro that would copy a large
amount of data (20,000 rows of data) however I need to do
100 rows every 1 second. Therefore I need some sort of
function that will have a time delay of 1 second within
the macro. (copy 100 rows wait one second, copy 100 rows
wait one sec etc)

Does anyone know of a function that will create a time
delay within a macro?


thanks in advance
 
hi,
Application.Wait (Now + TimeValue("0:00:01"))
this vb code line will pause code excecution for 1 second
you will have to work it in somehow because i'm not
understanding the 1 second per 100 lines thing.
regards
Frank
 
Frank,

Thank you very much. This works great!

One more question: Is there a way to have a 1.5 second
delay? I tried ("0:00:015) and it did not work.

thanks,

mike
 
Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)

Function ADelay(mSecs)
Sleep mSecs
End Sub


Adelay 1500

waits one and a half seconds
 
I don't think you can get a second and a half. I think you have to use
whole seconds.
 
thank you!
-----Original Message-----
Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)

Function ADelay(mSecs)
Sleep mSecs
End Sub


Adelay 1500

waits one and a half seconds


--

HTH

RP




.
 
Back
Top