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
|
Sub Compare_EK_V2()
Dim LigneTitre As Long
Dim DerniereLigne As Long
Dim AireDoublons As Range
Dim CelluleDoublons As Range
With Sheets("Incidents créés")
LigneTitre = 3
DerniereLigne = .Cells(.Rows.Count, 2).End(xlUp).Row ' 2 parce que la colonne A est vide
.Columns(3).Insert Shift:=xlToRight, CopyOrigin:=xlFormatFromLeftOrAbove
.Range("C3") = "Double"
Set AireDoublons = .Range(.Cells(LigneTitre + 1, 3), .Cells(DerniereLigne, 3))
With .Range("C4")
.FormulaR1C1 = "=IF(R[1]C[-1]=RC[-1],""Double"",""OK"")"
.AutoFill Destination:=AireDoublons
End With
For Each CelluleDoublons In AireDoublons
If CelluleDoublons = "Double" Then
With CelluleDoublons.Font
.Color = RGB(255, 0, 0)
.Bold = True
End With
End If
Next CelluleDoublons
Set AireDoublons = Nothing
End With
End Sub |
Partager