Sub Testmoispeochain()
Dim i&, w As Worksheet
Application.ScreenUpdating = False
Worksheets("données").range("A2:I6000").Copy
Sheets.Add After:=Sheets(Sheets.Count)
Set w = ActiveSheet
w.Paste
For i = w.Cells(Rows.Count, 1).End(xlUp).Row To 3 Step -1
If Month(Date) <> 12 Then
If Month(w.Cells(i, 9)) <> Month(Date) + 1 Or Year(w.Cells(i, 9)) <> Year(Date) Then w.Cells(i, 1).EntireRow.Delete
Else
If Month(w.Cells(i, 9)) <> 1 Or Year(w.Cells(i, 9)) <> Year(Date) + 1 Then w.Cells(i, 1).EntireRow.Delete
End If
Next i
i = w.Cells(Rows.Count, 1).End(xlUp).Row + 1
Do
If w.Cells(i, 9).Interior.Color = Worksheets("données").Cells(3, 1).Interior.Color Then Cells(i, 1).EntireRow.Delete
Loop Until w.Cells(i, 9).Interior.Color <> Worksheets("données").Cells(3, 1).Interior.Color
i = w.Cells(Rows.Count, 1).End(xlUp).Row
w.Rows("1:" & i).Copy Destination:=Worksheets("Dashboard").Cells(10, 1)
Application.DisplayAlerts = False
w.Delete
Application.DisplayAlerts = True
Worksheets("données").Cells.Copy
Sheets("Dashboard").Activate
Cells.PasteSpecial Paste:=xlPasteColumnWidths
Application.ScreenUpdating = True
range("A3").Select
End Sub