1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
|
Sub colorMax()
Dim CptLig As Integer
Dim CptCol As Byte, ColMax As Byte
ColMax = Feuil1.Rows(1).SpecialCells(xlCellTypeLastCell).Column - 1
For CptLig = 2 To Feuil1.Columns(ColMax).SpecialCells(xlCellTypeLastCell).Row
Feuil1.Cells(CptLig, ColMax).Interior.ColorIndex = xlNone
For CptCol = 1 To ColMax - 1
If Not IsError(Feuil1.Cells(CptLig, CptCol).Value) Then
If Feuil1.Cells(CptLig, CptCol).Value = Feuil1.Cells(CptLig, ColMax).Value Then
Feuil1.Cells(CptLig, ColMax).Interior.ColorIndex = Feuil1.Cells(1, CptCol).Interior.ColorIndex
Exit For
End If
End If
Next CptCol
Next CptLig
End Sub |