'---------------------------------------------------------------------------------------------------------------
Sub MAX_MIN_Color()
Dim Plage As Range, PlageImpaire As Range, PlagePaire As Range
Dim c As Range
For Each c In [B4:G20]
Set Plage = Range("B" & c.Row, "G" & c.Row)
Set PlageImpaire = Range("B" & c.Row)
Set PlagePaire = Range("B" & c.Row)
For i = 2 To Plage.Columns.Count
If i / 2 = CInt(i / 2) Then
Set PlagePaire = Union(PlagePaire, Cells(c.Row, i))
Else
Set PlageImpaire = Union(PlageImpaire, Cells(c.Row, i))
End If
Next
'PlagePaire.Select
'PlagePaire.Cells.Interior.ColorIndex = 4
'PlageImpaire.Select
'PlageImpaire.Cells.Interior.ColorIndex = 43
PMin = Application.WorksheetFunction.Min(PlagePaire)
PMax = Application.WorksheetFunction.Max(PlagePaire)
IPMin = Application.WorksheetFunction.Min(PlageImpaire)
IPMax = Application.WorksheetFunction.Max(PlageImpaire)
'-------------------------
With PlagePaire
L1 = .Find(PMin, LookIn:=xlValues, Lookat:=xlWhole).Row
C1 = .Find(PMin, LookIn:=xlValues, Lookat:=xlWhole).Column
L2 = .Find(PMax, LookIn:=xlValues, Lookat:=xlWhole).Row
C2 = .Find(PMax, LookIn:=xlValues, Lookat:=xlWhole).Column
End With
Cells(L1, C1).Interior.ColorIndex = 12
Cells(L2, C2).Interior.ColorIndex = 19
'-----------------
With PlageImpaire
iL1 = .Find(PMin, LookIn:=xlValues, Lookat:=xlWhole).Row
iC1 = .Find(PMin, LookIn:=xlValues, Lookat:=xlWhole).Column
iL2 = .Find(PMax, LookIn:=xlValues, Lookat:=xlWhole).Row
iC2 = .Find(PMax, LookIn:=xlValues, Lookat:=xlWhole).Column
End With
Cells(iL1, iC1).Interior.ColorIndex = 12
Cells(iL2, iC2).Interior.ColorIndex = 19
Next
End Sub
'---------------------------------------------------------------------------------------------------------------