1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
|
Sub IdentifieDoublons(Plg As Range)
Dim Un As Collection
Set Un = New Collection
On Error Resume Next
With Sheets("feuil1") 'à adapter avec nom feuille
For Each cel In Plg 'il faut declarer au préalable cel
If cel <> "" Then
Un.Add cel, CStr(cel)
If Err <> 0 Then
.Range("A" & cel.Row - 1, "L" & cel.Row).Interior.ColorIndex = 6 'à toi de voir
If cel(0, 2) <> cel(1, 2) Then 'à toi de voir quelles cellules
.Range(cel(0, 2).Address, cel(1, 2).Address).Interior.ColorIndex = 7 'à toi de voir
End If
End If
'Efface toutes les valeurs de l'objet Err.
Err.Clear
End If
Next cel
End With
Set Un = Nothing
End Sub
'c'est un code que je possède, donc à adapter |
Partager