Do Event

  • Thread starter Thread starter John Gittins
  • Start date Start date
J

John Gittins

I find that it takes several clicks of the cancel button to get the routine
to stop. Can anyone think how to get it to stop on the first click. The
routine uses the form as a count down clock.

Sub DaysLeft()
Do While TEnd = 0
DaysTG = DateValue("12/17/03") - 1 - DateValue(Now())
HrsTG = Hour("12/17/03 23:59:59") - Hour(Now())
MinsTG = Minute("12/17/03 23:59:59") - Minute(Now())
SecsTG = Second("12/17/03 23:59:59") - Second(Now())
DoEvents
UserForm1.TextBox1 = DaysTG
UserForm1.TextBox2 = HrsTG
UserForm1.TextBox3 = MinsTG
UserForm1.TextBox4 = SecsTG
DoEvents

Loop
Unload UserForm1
End Sub
 
Back
Top