Private Sub CommandButton1_Click()
Static defil As Boolean
Dim c As Range, F As Object, t As Double
defil = Not defil
CommandButton1.Caption = IIf(defil, "Arrêter", "Lancer") & " le défilement"
If Not defil Then Exit Sub
On Error Resume Next 'si une feuille n'existe pas
1 With Sheets("PARAM") 'feuille à adapter
For Each c In .Range("A1", .Range("A" & .Rows.Count).End(xlUp)(2))
If c = "" Then GoTo 1
Set F = Nothing: Set F = Sheets(CStr(c))
If F Is Nothing Then
MsgBox "La feuille '" & c & "' n'existe pas..."
Else
F.Activate
t = Now + Val(c(1, 2)) / IIf(c(1, 3) Like "m*", 1440, 86400)
While Now < t
If Not defil Then Exit Sub 'arrête la boucle
DoEvents
Wend
End If
Next
End With
End Sub