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
| Dim Ws As Worksheet
Dim DerLig As Long
Dim r As Long
Dim Mbody As String
Dim Cdo_Message As Object
Set Ws = Sheets("Feuil1")
DerLig = Ws.Cells(Columns(1).Cells.Count, 1).End(xlUp).Row
'tout d'abors ici !!!!!! quand on test avec un if a part avec un boolean on demande quelque chose toi tu ne demande rian
' donc if ta cellule QUOI???????
For r = 2 To DerLig
If Ws.Cells(r, 4)
Mbody = Mbody & " / " & Ws.Cells(r, 1) 'il faut eviter ce genre de caractere dans la concatenation !!!!!!
End If
Next r
Set Cdo_Message = CreateObject("CDO.Message")
With Cdo_Message
'ENSUITE ICI IL TE MANQUE LA CONFIGURATION DE CDO (SERVEURSORTANT,(FACULTATIF USERNAME ET PASSWORD))
.To = "adresseresponsable" & Chr(64)'ceci est en trop si il n'y a qu'un seul adresse mail
.From = "adresseresponsableRH" & Chr(64)'pareil
.Subject = "Alerte renouvellement"
.HTMLBody = Mbody & Cdo_Message.HTMLBody' il y a un point c'est quoi cet object d'ou il viens !!!!!
'.Cc = "LeCC" & Chr(64) & "adresse stagiaire"
.Send
End With
Set Cdo_Message = Nothing
End Sub |
Partager