1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
|
Sub Coloriage()
Dim rngSituation As Range
Dim lngMaxRow As Long
Dim i As Long
Dim Status As String
'A remplacer par la colonne situation
Set rngSituation = ActiveSheet.Range("D:D")
lngMaxRow = rngSituation.Parent.UsedRange.Rows.Count
For i = 2 To lngMaxRow
Status = rngSituation.Cells(i, 1).Value
Select Case Status
Case "En cours": rngSituation.Cells(i, 1).EntireRow.Interior.ColorIndex = 46
Case "Litige clos": rngSituation.Cells(i, 1).EntireRow.Interior.ColorIndex = 5
Case "Demande refusée": rngSituation.Cells(i, 1).EntireRow.Interior.ColorIndex = 3
Case "Avoir à établir": rngSituation.Cells(i, 1).EntireRow.Interior.ColorIndex = 4
End Select
Next i
End Sub |