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
| Sub Correction_doublons()
Dim i As Byte, j As Byte
Dim LastLigA As Long, LastLigB As Long
Dim TF As Variant
Application.ScreenUpdating = False
TF = Array("feuil1", "feuil2", "feuil3", "feuil4")
For i = LBound(TF) To UBound(TF)
With Sheets(TF(i)).Range("B9:B" & Rows.Count & ",G9:G" & Rows.Count)
.Font.Bold = False
.Font.ColorIndex = 1
.Interior.ColorIndex = None
End With
Next i
For i = LBound(TF) To UBound(TF)
LastLigA = Sheets(TF(i)).Cells(Rows.Count, 1).End(xlUp).Row
For j = i To UBound(TF)
LastLigB = Sheets(TF(j)).Cells(Rows.Count, 1).End(xlUp).Row
CDouble Sheets(TF(i)).Range("B9:B" & LastLigA), Sheets(TF(j)).Range("B9:B" & LastLigB)
CDouble Sheets(TF(i)).Range("G9:G" & LastLigA), Sheets(TF(j)).Range("C9:C" & LastLigB)
Next j
Next i
End Sub |