Option Explicit Dim avance As Long Sub Form_Load() avance = 0 Timer1.Interval = 1000 Timer1.Enabled = True End Sub Sub Timer1_Timer() Dim hh As Long Dim mn As Long Dim ss As Long Dim trans As String avance = avance + 1 ss = avance hh = ss \ 3600 ss = ss - (hh * 3600) mn = ss \ 60 ss = ss - (mn * 60) trans = hh & "h" & Format(mn, "00") & "'" & Format(ss, "00") DoEvents Label1 = trans End Sub
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre questionPrivate toto As Date Private Sub Command1_Click() Timer1.Enabled = True Timer1.Interval = 1000 toto = Now End Sub Private Sub Timer1_Timer() Label1.Caption = TimeSerial(0, 0, DateDiff("s", Now, toto)) End Sub
Private toto As Date Private Sub Command1_Click() Timer1.Enabled = True Timer1.Interval = 1000 toto = Now + TimeValue("01:02:15") End Sub Private Sub Timer1_Timer() Label1.Caption = TimeSerial(0, 0, -DateDiff("s", Now, toto)) End Sub