Wait Timer VBA

The solution for “Wait Timer VBA” can be found here. The following code will assist you in solving the problem.

Public Function Pause(NumberOfSeconds As Variant)
On Error GoTo Error_GoTo

Dim PauseTime As Variant
Dim Start As Variant
Dim Elapsed As Variant

PauseTime = NumberOfSeconds
Start = Timer
Elapsed = 0
Do While Timer < Start + PauseTime Elapsed = Elapsed + 1 If Timer = 0 Then ' Crossing midnight PauseTime = PauseTime - Elapsed Start = 0 Elapsed = 0 End If DoEvents Loop Exit_GoTo: On Error GoTo 0 Exit Function Error_GoTo: Debug.Print Err.Number, Err.Description, Erl GoTo Exit_GoTo End Function

Thank you for using DeclareCode; We hope you were able to resolve the issue.

More questions on [categories-list]

Similar Posts