Sub Export()
'Déclaration des worksheets
Dim i&, F As Worksheet, G As Worksheet
Set F = Sheets("recupération")
Set G = Sheets("certification")
'Boucle qui teste la date et fait la recopie dans l'onglet récupération
With Sheets("table1")
For i = 3 To .Cells(.Rows.Count, 3).End(3).Row
'If .Cells(i, 3) = Date Then
If .Cells(i, 3) <= Date And .Cells(i, 19).Value <> "Env" Then
Application.Union(.Cells(i, 3), .Cells(i, 6), .Cells(i, 7), .Cells(i, 9)).Copy _
F.Cells(Application.WorksheetFunction.Max(F.Cells(F.Rows.Count, 1).End(3)(2).Row, 3), 1)
With .Cells(i, 19)
.Value = "Env"
.Interior.ThemeColor = xlThemeColorAccent3
.Interior.TintAndShade = -0.249946592608417
End With
'Boucle qui teste la date et fait la recopie dans l'onglet certification
If (Date = .Cells(i, 13) + 20) And (.Cells(i, 20) = "C") And (.Cells(i, 21).Interior.ColorIndex = 3) Then
Application.Union(.Cells(i, 3), .Cells(i, 6), .Cells(i, 7), .Cells(i, 20), .Cells(i, 21)).Copy _
G.Cells(Application.WorksheetFunction.Max(G.Cells(G.Rows.Count, 1).End(3)(2).Row, 3), 1)
With .Cells(i, 21)
.Value = "Payé"
.Interior.ThemeColor = xlThemeColorAccent3
.Interior.TintAndShade = -0.249946592608417
End With
End If
End If
Next i
End With
End Sub