Sub DOUBLONS()
Application.ScreenUpdating = False
Dim TabHisto() As Variant
With Sheets("Histo")
finH = .UsedRange.Rows.Count
TabHisto = .Range("A1:AN" & finH).Value 'on met toutes les infos de la feuille Histo dans un tablo
End With
For I = LBound(TabHisto, 1) To UBound(TabHisto, 1) - 1 'on check les doublons
If TabHisto(I, 1) = TabHisto(I + 1, 1) And TabHisto(I, 5) = TabHisto(I + 1, 5) And TabHisto(I, 39) = TabHisto(I + 1, 39) Then
TabHisto(I, 40) = "VRAI"
End If
Next I
For I = LBound(TabHisto, 1) To UBound(TabHisto, 1) 'on parcourt tout le tableau "Histo"
If TabHisto(I, 40) = "VRAI" Then 'si c'est un doublon
With Sheets("Traitement") 'on colle les info dans la feuille traitement
.Range("A" & .Rows.Count).End(xlUp).Offset(1, 0) = TabHisto(I, 1)
For j = LBound(TabHisto, 2) + 1 To UBound(TabHisto, 2)
.Range("A" & .Rows.Count).End(xlUp).Offset(0, j - 1) = TabHisto(I, j)
Next j
End With
End If
Next I
Application.ScreenUpdating = True
End Sub