XL 2016 Compte à rebours dans un userform

Goose

XLDnaute Occasionnel
Bjr à tous,
voilà je n'arrive pas identifier le bug dans le code suivant:
VB:
Private Sub CommandButton1_Click()
a = UserForm2.TextBox1.Value
b = UserForm2.TextBox2.Value
c = UserForm2.TextBox3.Value
d = UserForm2.TextBox4.Value
e = UserForm2.TextBox5.Value
f = UserForm2.TextBox6.Value

n = a * 10 * 60 * 60 + b * 60 * 60 + c * 10 * 60 + d * 60 + e * 10 + f
Unload Me
UserForml.Show
UserForml.Label1.Caption = a & b & ":" & c & d & ":" & e & f
For i = 1 To n
Application.Wait (Now + #12:00:01 AM#)
DoEvents
UserForml.Label1.Caption = Format(DateAdd("s", -1, UserForml.Label1.Caption), "hh:mm:ss")
UserForml.Label3.Width = 276 - 276 * i / n
If UserForml.Label1.Caption < #12:00:11 AM# Then
Beep
End If
Next
End Sub
je joint un fichier explicatif
merci d'avance
bye
 

Pièces jointes

  • Marqueur-2eEcran.xlsm
    28.3 KB · Affichages: 5

Discussions similaires

Statistiques des forums

Discussions
313 769
Messages
2 102 234
Membres
108 181
dernier inscrit
Chr1sD