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 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47
| Private Sub Workbook_Open()
Dim i As Long
Dim j As Long
Dim Sh As Worksheet
Dim Plage As Range
Dim adresse As String
Dim Current As Worksheet
Cells.EntireRow.Hidden = False
For Each Current In Worksheets
Set Sh = ThisWorkbook.Worksheets("CDG")
With Sh
For i = 6 To .Range("A" & Rows.Count).End(xlUp).Row
.Cells.EntireRow.Hidden = False
For j = 10 To 12
.Cells.EntireRow.Hidden = False
If CDate(.Cells(i, j)) = Format(Now, "dd/mm/yyyy") Then
No_Dossier = .Cells(i, 1).Value
No_Declaration = .Cells(i, 2).Value
Client = .Cells(i, 3).Value
No_Document = .Cells(i, 4).Value
Date_expiration = .Cells(i, 7).Value
Cells.EntireRow.Hidden = True
With .MailEnvelope
.Introduction = "Bonjour, merci de relancer le client pour le dossier suivant : " & vbCrLf & _
"N° de dossier: " & No_Dossier & vbCrLf & _
"N° de déclaration: " & No_Declaration & vbCrLf & _
"Client: " & Client & vbCrLf & _
"N°document: " & No_Document & vbCrLf & _
"Date expiration: " & Date_expiration
.Item.To = Sh.Cells(i, 9).Value
.Item.Subject = " --RELANCE DOCUMENT A REGULARISER SOUS D48-- "
.Item.send
End With
End If
Next j
Next i
End With
Next
Set Sh = Nothing
Cells.EntireRow.Hidden = False
End Sub |