Sub envoimail()
Dim messagerie As Object
Dim email As Object
Dim cel As Range
Dim delai As Integer
Set messagerie = CreateObject("Outlook.Application")
delai = 1 'jours
For Each cel In Range("A4:A" & Range("A4").End(xlDown).Row)
If cel.Offset(, 7).Value - Now < delai Then
Set email = messagerie.CreateItem(0)
With email
.to = "monadresseemail@toto.fr"
.Subject = "mettre ici le titre du mail"
.body = "Bonjour, la tâche " & cel.Offset(, 2) & " arrive à échéance." & vbCrLf & "Merci de la traiter dès que possible." & vbCrLf & "Cordialement"
.ReadReceiptRequested = True
.display ' à remplacer par .send si ok
End With
Set email = Nothing
End If
Next cel
Set messagerie = Nothing
End Sub