Option Explicit Dim starttime As LongPrivate Sub Command1_Click() Text1 = 0 Timer1.Interval = 300 Timer1.Enabled = True starttime = Timer End SubPrivate Sub Form_Load() Timer1.Enabled = False End SubPrivate Sub Timer1_Timer() Label1 = Timer - starttime Text1 = Text1 + 1 If Text1 = "100" Then Timer1.Enabled = False End Sub
Dim starttime As LongPrivate Sub Command1_Click()
Text1 = 0
Timer1.Interval = 300
Timer1.Enabled = True
starttime = Timer
End SubPrivate Sub Form_Load()
Timer1.Enabled = False
End SubPrivate Sub Timer1_Timer()
Label1 = Timer - starttime
Text1 = Text1 + 1
If Text1 = "100" Then Timer1.Enabled = False
End Sub