Excel VBA delay between two statements

  • checking the VBA Help for the command "Wait"

    newHour = Hour(Now())
    newMinute = Minute(Now())
    newSecond = Second(Now()) + 10
    waitTime = TimeSerial(newHour, newMinute, newSecond)
    Application.Wait waitTime

    So if you want to delay 1 minute then
    Application.Wait (now() + timevalue("00:01:00"))

    The only issue I have with wait is that it pauses all execution. I'm pretty sure you can't even enter data on a worksheet during this time.

  • You'll have to test to see if it hangs the app. I'm thinking it will just for the simple reason of the command is WAIT.

    Other than that you'ld have to program your own testing routine to test for conditions to continue. Then use the appliction ontime function to determine when it's save to continue.

    The latter method can be a real pain depending on how your code is currently written.

    Good Luck,