Sub colorationCellules_ii()
[COLOR=SeaGreen]'code initial:CBernardT [/COLOR] [B](edition : Houps désolé) [/B]
[COLOR=SeaGreen]'code adapté: Marcel32[/COLOR]
Dim Derlig As Long, i As Long, Color As Byte
Dim Fond As Integer, Bleu As Integer, Jaune As Integer
Bleu = 34
Jaune = 36
With Sheets("Feuil1")
Derlig = .Range("A65536").End(xlUp).Row
Fond = Bleu
For i = 1 To Derlig
If i = 1 Then
.Cells(i, 1)[B][COLOR=Red].Resize(1, 7)[/COLOR][/B].Interior.ColorIndex = Fond
ElseIf Left(.Cells(i, 1), 1) <> Left(.Cells(i - 1, 1), 1) Then
If Fond = Bleu Then
Fond = Jaune
Else
Fond = Bleu
End If
.Cells(i, 1)[COLOR=Red][B].Resize(1, 7)[/B][/COLOR].Interior.ColorIndex = Fond
ElseIf Left(.Cells(i, 1), 1) = Left(.Cells(i - 1, 1), 1) Then
.Cells(i, 1)[B][COLOR=Red].Resize(1, 7)[/COLOR][/B].Interior.ColorIndex = Fond
End If
Next i
End With
End Sub