ah forse ho capito... nel foglio metto:
e invece nel modulo metto:codice:Private Sub CommandButton1_Click() StartMyTimer End Sub
giusto? ci ho azzeccato?codice:Public TimeRun As Double Public Sub StartMyTimer() TimeRun = Now + TimeSerial(0, 0, 1) Application.OnTime EarliestTime:=TimeRun, Procedure:="Dosomething", _ Schedule:=True End Sub Public Sub Dosomething() totale = Range("B4").Value ultimo = Range("B3").Value differenza = totale - ultimo If differenza >= 20 Then MsgBox "esegui manutenzione" Range("B3").Value = totale End If StartMyTimer End Sub

Rispondi quotando