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
|
For l = 1 To 10
For c = 1 To 10
RetourneCodeCouleur = Sheets("Feuil1").Cells(l, c).Interior.ColorIndex
Couleur = 3 ' Rouge
If RetourneCodeCouleur <> Couleur Then
'Si la cellule n'est pas rouge on la grise
Range(Cells(l, c), Cells(l, c)).Interior.Pattern = xlSolid
Range(Cells(l, c), Cells(l, c)).Interior.PatternColorIndex = xlAutomatic
Range(Cells(l, c), Cells(l, c)).Interior.ThemeColor = xlThemeColorDark1
Range(Cells(l, c), Cells(l, c)).Interior.TintAndShade = -0.149998474074526
Range(Cells(l, c), Cells(l, c)).Interior.PatternTintAndShade = 0
Else
Range(Cells(l, c), Cells(l, c)).Interior.Pattern = xlSolid
Range(Cells(l, c), Cells(l, c)).Interior.PatternColorIndex = xlAutomatic
Range(Cells(l, c), Cells(l, c)).Interior.ThemeColor = xlThemeColorDark1
Range(Cells(l, c), Cells(l, c)).Interior.ColorIndex = Couleur
Range(Cells(l, c), Cells(l, c)).Interior.PatternTintAndShade = 0
End If
Next c
Next l |
Partager