Reputation: 1420
I would like some help to understand why the function doSomething is not running.
Calculation mode is on Automatic
Sub Test()
check = 0
Debug.Print "Timer_1: " & Now()
Call runFromNow("doSomething", "00:00:05")
Do While check = 0
DoEvents
Loop
Debug.Print "Timer_2: " & Now()
End Sub
Sub runFromNow(myProcedure As String, Optional myTime As Variant = "00:00:15")
If myProcedure <> "" Then
Application.OnTime Now + TimeValue(myTime), myProcedure
Debug.Print "runFromNow: Activated at " & Now + TimeValue(myTime)
End If
End Sub
Sub doSomething()
check = 1
End Sub
Upvotes: 0
Views: 493
Reputation: 1202
You could try to get this one done with declaring a public variable.
I wrote this short test for giving you an example:
Public Check As Long
Sub Test()
Call Test_Dam
Debug.Print Check
End Sub
Sub Test_Dam()
Check = 1
End Sub
Your Debug.print will give you the 1 you need ;)
Upvotes: 3