Sub Bouton1_Clic()
Sheets(1).[A1] = 30
UserForm1.Show
End Sub
Sub decompte()
Dim a
If UserForm1.Visible = False Then
a = Now + TimeValue("00:00:01")
Application.OnTime a, procedure:="decompte"
Application.OnTime a, procedure:="decompte", Schedule:=False
Else
UserForm1.Label1.Caption = "Fermeture dans : " & Sheets(1).[A1] & " secondes" & vbLf & "Sauf si vous cliquez sur un bouton"
If Sheets(1).[A1] = 0 Then
UserForm1.Hide
Exit Sub
End If
Sheets(1).[A1] = Sheets(1).[A1] - 1
Application.OnTime Now + TimeValue("00:00:01"), procedure:="decompte"
End If
End Sub