Bonjour,
Je t'ai tricoté un messagebox pour les rappels...
Msg3 = 0 à 3 jours avant la date prévue
Msg7 = 4 à 7 jours avant la date prévue
Donc 3 options :
1- Msg3 > 0 et Msg7 = 0
2- Msg3 = 0 et Msg7 > 0
3- Msg3 > 0 et Msg7 > 0
Mets ta macro "Rappel" en commentaire ( ou utilise une copie du fichier ) et teste celle-ci pour voir si ce peut-être utile.
Sub rappel()
'
' rappel Macro
'
Dim tData()
Dim sData$, sData1$, sData2$
Dim X As Integer
Dim Y As Byte, Z As Long
Dim Ajout As String
Dim OutPut As Integer
Dim Msg3 As String, Msg7 As String
Application.ScreenUpdating = False
With Worksheets("BASE DE DONNEES")
.Range("$A$4:$L$" & .Range("C" & Rows.Count).End(xlUp).Row).AutoFilter Field:=7, Criteria1:="<>" ' active le filtre (était dans ton dernier fichier
tData = .Range("C5:G" & .Range("C" & Rows.Count).End(xlUp).Row - 1).Value ' place les données dans une variable tableau
End With
Msg3 = ("Clients à relancer ( 3 jours ou moins ) ")
Msg7 = ("Clients à relancer ( entre 4 et 7 jours )")
For X = 1 To UBound(tData, 1) ' ajoute des caractères entre le Point de vente et la date de rappel
Z = (Len(tData(X, 1)) + Len(tData(X, 5)) + 7)
For Y = 1 To 39
Ajout = Ajout & "-"
If Y + Z >= 39 Then
Exit For
End If
Next Y
' compose les messages
If tData(X, 5) <> "" And DateDiff("d", Date, CDate(tData(X, 5))) >= 0 And DateDiff("d", Date, CDate(tData(X, 5))) <= 3 Then sData1 = sData1 & tData(X, 1) & " le : " & Ajout & " " & tData(X, 5) & Chr(10)
If tData(X, 5) <> "" And DateDiff("d", Date, CDate(tData(X, 5))) >= 4 And DateDiff("d", Date, CDate(tData(X, 5))) <= 7 Then sData2 = sData2 & tData(X, 1) & " le : " & Ajout & " " & tData(X, 5) & Chr(10)
Ajout = ""
Next X
' affiche le / les messages
If sData1 = "" And sData2 <> "" Then OutPut = MsgBox(Msg7 & Chr(10) & sData2, vbMsgBoxRight)
If sData1 <> "" And sData2 = "" Then OutPut = MsgBox(Msg3 & Chr(10) & sData1, vbMsgBoxRight)
If sData1 <> "" And sData2 <> "" Then OutPut = MsgBox(Msg3 & Chr(10) & sData1 & Chr(10) & Msg7 & Chr(10) & sData2, vbMsgBoxRight)
End Sub
ric