Quantcast
Channel: Excel Help Forum - Excel Programming / VBA / Macros
Viewing all articles
Browse latest Browse all 50076

Multiple Timer Running

$
0
0
Hello,
I'm working on evaluating the time on different items, each time has to had a record longer than 20 min before I can release it, I pull the original time stamp from a data base and then I want to evaluate it against "Now()" if the time is f.e. 18 minutes difference from time stamp to "Now()" then I want to run a counter for 2min in the background and keep evaluating other items, when the two minutes are passed, then get a notification of that item has completed the 20min,

can someone please help me on this, this is the code I have so far:

Code:

Sub TimeEvaluator()
Dim Difference
Dim DifferenceTweinty


Difference = DateDiff("n", Range("b4").Value, Now())
If Difference > 20 Then
MsgBox "El carton paso hace mas de 20 min, si no has recibido un NegFA pasalo directo a Embarques"
ElseIf Difference < 20 Then
DifferenceTweinty = 20 - Difference
Application.OnTime Now() + TimeValue(DifferenceTweinty), "Timer"
End If

End Sub
Private Sub Timer()
    MsgBox "Notification"
End Sub


Viewing all articles
Browse latest Browse all 50076

Trending Articles