Sub GOAuto()
Dim HrREQ1 As Date
Dim HrREQ2 As Date
Dim JrSEM As Integer
JrSEM = Weekday(Now(), vbMonday)
'HrREQ1 = TimeSerial(22, 22, 0)
HrREQ1 = Now + TimeSerial(0, 1, 0) 'Dans 1 minute
HrREQ2 = Now + TimeSerial(0, 2, 0) 'Dans 2 minutes
If JrSEM = 5 Then
Application.OnTime HrREQ2, "REQAutomatique", , True
End If
If JrSEM < 5 Then
Application.OnTime HrREQ1, "REQAutomatique", , True
End If
If JrSEM > 5 Then
'Resume Next
End If
End Sub
Sub REQAutomatique()
MsgBox "C'est l'heure"
End Sub