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 Macro2()
'
' Macro2 Macro
' Colorie les cellule dont les valeurs sont repetees (doublon).
'
' Keyboard Shortcut: Ctrl+Shift+Q
'
Dim MaPlage As Range
Dim MaZone As Range
'Set MaPlage = ActiveSheet.Range("A3:A16")
Set MaPlage = InputBox("Please donner ici la zone a traiter dans le format ci-dessous" & vbCr & " Exemple: A1:B5", "RastaBomboclat")
'set Mazone = "
' Range("A3").Select
' Range(Selection, Selection.End(xlDown)).Select
MaPlage.Select
Selection.FormatConditions.Add Type:=xlExpression, Formula1:= _
"=COUNTIF($A$3:$A$16;A3)>1"
Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
With Selection.FormatConditions(1).Interior
.PatternColorIndex = xlAutomatic
.Color = 8314031
.TintAndShade = 0
End With
Selection.FormatConditions(1).StopIfTrue = False
Range("A1").Select
End Sub |
Partager