Private Sub Worksheet_Change(ByVal Target As Range)
[COLOR="DarkOrange"]'Doit être placé dans le module de la feuille concernée.[/COLOR]
If Not Intersect(Target, Me.Range("J7:J31")) Is Nothing Then COLORIE Intersect(Target, Me.Range("J7:J31")), 0, 4
End Sub
Sub COLORIE(p As Range, Optional cl As Long, Optional cc As Long)
[COLOR="DarkOrange"]'Peut être placé dans un module standard pour être appelé depuis plusieurs feuilles.[/COLOR]
Dim c, CV
For Each c In p
CV = c.Value
With c.Offset(cl, cc).Font
.ColorIndex = xlAutomatic
If IsNumeric(CV) And Not IsEmpty(CV) Then
Select Case CV
Case Is <= 10: .ColorIndex = 4
Case Is <= 30: .ColorIndex = 44
Case Else: .ColorIndex = 3
End Select
End If
End With
Next c
End Sub