Private Sub Worksheet_Calculate()
Dim lundi As Date, dimanche As Date, r As Range
Application.EnableEvents = False
[C5:I18].ClearContents
If Not IsDate([I2] & "/" & [G2] & "/" & [D2]) Then Exit Sub
lundi = [C4]
dimanche = [I4]
With Sheets("Data")
Set r = .Range("A2", .Range("A" & .Rows.Count).End(xlUp))
End With
On Error Resume Next
For Each r In r
If r(1, 2) >= lundi And r(1, 2) <= dimanche Or Range(r).Value <> "" Then: Range(r) = r(1, 3): _
Range(r).Interior.Color = r(1, 9).Interior.Color
Next
Application.EnableEvents = True
End Sub