1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
|
'------ dans un module standard -------
Option Explicit
Public Btn As Boolean
Sub Temporisation()
'timer toutes les secondes
Application.OnTime Now + TimeValue("00:00:01"), "maMacro"
End Sub
Sub maMacro()
'
'incementation de la cellule B1
Range("B1") = Range("B1") + 1
'
If Btn = False Then
Finir
Exit Sub
End If
Temporisation
End Sub
Sub Finir()
On Error Resume Next
Application.OnTime Now + TimeValue("00:00:01"), _
"maMacro", , Schedule:=False
End Sub |
Partager