conditions multiples pour envoi de mail automatique
Bonjour,
Je souhaiterais envoyer des emails avec plusieurs conditions mais lorsque je modifie le code il ne marche plus. Je souhaite envoyer un email quand les conditions oui et Fr sont réunis ou un autre email quand c'est oui et En. Dès que j'ai rajouté les conditions avec Fr ou En le code ne fonctionnait plus.
merci d'avance,
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
| Sub Emailvalidationpaiement()
Dim OutApp As Object
Dim OutMail As Object
Dim cell As Range
Application.ScreenUpdating = False
Set OutApp = CreateObject("Outlook.Application")
On Error GoTo cleanup
For Each cell In Columns("D").Cells.SpecialCells(xlCellTypeConstants)
If cell.Value Like "?*@?*.?*" And _
LCase(Cells(cell.Row, "K").Value) = "oui" _
And LCase(Cells(cell.Row, "J").Value) = "Fr" _
And LCase(Cells(cell.Row, "L").Value) <> "send" Then
Set OutMail = OutApp.CreateItem(0) |