How to give a time delay of less than one second in excel vba?

后端 未结 10 2163
孤街浪徒
孤街浪徒 2020-11-29 06:14

i want to repeat an event after a certain duration that is less than 1 second. I tried using the following code

Application.wait Now + TimeValue (\"00:00:01\         


        
10条回答
  •  盖世英雄少女心
    2020-11-29 06:51

    call waitfor(.005)

    Sub WaitFor(NumOfSeconds As Single)
        Dim SngSec as Single
        SngSec=Timer + NumOfSeconds
    
        Do while timer < sngsec
            DoEvents
       Loop
    End sub
    

    source Timing Delays in VBA

提交回复
热议问题