PDA

Click to See Complete Forum and Search --> : VBA Wait command?


TheRobster
Feb 23rd, 2006, 02:16 PM
Hi all,

Is there a command within Excel VBA that will cause a macro to pause for a set amount of time? I have found the following which pauses it but the minimum pause time is 1 second, and this is too long:

Application.Wait Now + TimeValue("00:00:01")

What I need is something that pauses for, say, 0.1 seconds. Is there anyway to do this?

Cheers
-Rob

RobDog888
Feb 23rd, 2006, 02:30 PM
Use the Sleep API in a Module. Then call it from anywhere. It pauses by miliseconds.
Public Declare Sub Sleep Lib "kernel32.dll" (ByVal dwMilliseconds As Long)