1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
|
'Colorie les lignes des colonnes en inverse
Vert = 34
Jaune = 36
With Sheets("Feuil3")
Derlig = .Range("A65536").End(xlUp).Row
Fond = Vert
For i = 2 To Derlig
aaa = Right(Cells(i, 11), 1)
If i = 1 Then
.Cells(i, 16).Resize(15, 4).Interior.ColorIndex = Fond
ElseIf Left(.Cells(i, 11), aaa) <> Left(.Cells(i - 1, 1), 1) Then
If Fond = Vert Then
Fond = Jaune
Else
Fond = Vert
End If
.Cells(i, 16).Resize(15, 4).Interior.ColorIndex = Fond
ElseIf Left(.Cells(i, 11), aaa) = Left(.Cells(i - 1, 1), 1) Then
.Cells(i, 16).Resize(15, 4).Interior.ColorIndex = Fond
End If
Next i
End With |
Partager