Option Explicit
Public NewTime As Double, intervalle As Double
Sub marche()
intervalle = TimeValue("01:00")
NewTime = intervalle * (1 + Int(Now / intervalle))
Application.StatusBar = "Prochaine capture : " & Format(NewTime, "h:mm")
Application.OnTime NewTime, "Action"
End Sub
Sub Arret()
Application.OnTime NewTime, "Action", False
Application.StatusBar = "Arret capture : " & Format(NewTime, "h:mm")
End Sub
Sub Action()
Dim LastRow As Long
With Sheets("feuil2")
LastRow = Range("a36565").End(xlUp).Row
If Now > .Cells(LastRow, 1) Then
Beep
.Cells(LastRow + 1, 1) = Now
.Cells(LastRow + 1, 2) = Sheets("feuil1").Range("C1")
Call marche
ThisWorkbook.Save
Beep
End If
End With
End Sub