Fermeture Userform à une valeur

Bonsoir, j'ai un compte à rebour je souhaiterai fermer l'userfom quand le compte à rebour est fini mais je bloque.

Merci

16cptereboursusf.xlsm (19.21 Ko)

Salut,

Il manquait juste un petit truc

Sub ExecutionTimer()
  UserForm1.Label1.Caption = Format(Dheure - Now(), "hh:mm:ss")
  If Dheure - Now() > 0 Then
    Lheure = Now() + TimeSerial(0, 0, 1)
    Application.OnTime Lheure, "ExecutionTimer"
  Else
    ArretTimer
    UserForm1.Label1.Caption = "Terminé !"
    ' Fermer l'USF
    Unload UserForm1
  End If
End Sub

A+

Un grand merci mais j'arrive pas a associer les deux derniere action ensemble

Sub ExecutionTimer()
UserForm_Minuteur.Label1.Caption = Format(Dheure - Now(), "hh:mm:ss")
If Dheure - Now() > 0 Then
Lheure = Now() + TimeSerial(0, 0, 1)
Application.OnTime Lheure, "ExecutionTimer"
Else
Unload UserForm_Minuteur
deconnexion
End If
End Sub

Une petite idée?

Sub ExecutionTimer()
     UserForm_Minuteur.Label1.Caption = Format(Dheure - Now(), "hh:mm:ss")
     If Dheure - Now() > 0 Then
       Lheure = Now() + TimeSerial(0, 0, 1)
       Application.OnTime Lheure, "ExecutionTimer"
     Else
       ArretTimer
       ' Fermer l'USF
        Unload UserForm_Minuteur
     End If
End Sub

Bonjour, impec

Merci

Rechercher des sujets similaires à "fermeture userform valeur"