Sub envoi2()With Sheets("Bat X")
'MsgBox a
For i = 8 To Range("b65000").End(xlUp).Row
a = Application.CountIf(Range("D" & i & ":L" & i), "en attente")
If a > 0 Then
For j = 4 To 12
If Cells(i, j) = "en attente" Then Cells(i, 20) = Cells(i, 20) & Chr("10") & "- " & Cells(7, j)
Next
docs = .Cells(i, 20)
dest = .Cells(i, 13)
copie = .Cells(i, 14) & ";" & .Cells(i, 15)
ST = .Cells(i, 3)
Set imsg = CreateObject("CDO.Message")
Set iconf = CreateObject("CDO.Configuration")
With imsg
Set .Configuration = iconf
'If .Attachments.Count <> 0 Then .Attachments.Delete (1)
.To = dest
.CC = copie
'.BCC =
.From = ton mail entre ""
.Subject = "Relance " & ST
.textbody = "Bonjour, voici les pièces manquantes à votre dossier: " & Chr("10") & Cells(i, 20).Value
.send
End With
End If
Next
Columns("T").ClearContents
End With
End Sub