Public Cptlance
Sub LancerCompteur()
Sheets("Feuil1").Select
ActiveSheet.Unprotect
Cptlance = 1
[Temps] = 10
[Texte] = ""
Lancer
End Sub
Sub ExecuterTimer()
If Cptlance = 0 Then Exit Sub
If [Temps] = 0 Then
Cptlance = 0
[Texte] = "Le temps est écoulé."
Sheets("Feuil1").Select
ActiveSheet.Protect DrawingObjects:=False, Contents:=True, Scenarios:=True
Else
[Temps] = [Temps] - 1
End If
t = Now + TimeSerial(0, 0, 1)
Application.OnTime t, "ExecuterTimer"
End Sub
Sub Lancer()
t = Now + TimeSerial(0, 0, 1)
Application.OnTime t, "ExecuterTimer"
End Sub