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 33
|
Sub Relances()
Dim Rep As Integer
Dim SendingDate As Date
Dim Alert1date As Date
Dim Alert2date As Date
Dim Alert3date As Date
Dim Status As String
i = 5
Status = Range("I" & i).Value
Do
If Status = "Pending" Then
SendingDate = FormatDateTime(Range("J" & i).Value)
Alert1date = FormatDateTime(Range("K" & i).Value)
If Date > (SendingDate + 15) And IsEmpty(Alert1date) Then
MsgBox "Nouvelle alerte n°1 pour " & vbLf & vbLf & Range("A" & i).Value & " " & Range("B" & i).Value, , "Nouvelle alerte"
Rep = MsgBox("Avez vous envoyé le mail de relance ?", vbYesNo, "Mail de relance")
Select Case Rep
Case vbYes
Alert1date = Date
Range("N" & i).Value = "RELANCE N°2"
End Select
End If
End If
i = i + 1
Loop While i < 15
End Sub |
Partager