Private Sub Worksheet_Change(ByVal Target As Range)
Dim dt1 As Date
Dim dt2 As Date
Dim i As Integer
If Target.Count > 1 Then
Exit Sub
End If
For i = 6 To 15
If Target.Address = "$C$1" Or Target.Address = Cells(i, 4).Address Then
If Cells(i, 4) <> "" Then '' ajout si cellule différente de vide
If DateDiff("d", Range("C1").Value, Cells(i, 4).Value) < 0 Then
Range(Cells(i, 2), Cells(i, 17)).Interior.Color = RGB(230, 215, 200)
Cells(i, 17).Value = "OK"
Else
Range(Cells(i, 2), Cells(i, 17)).Interior.Color = RGB(255, 255, 255)
Cells(i, 17).Value = ""
End If
Else '' ajout
Range(Cells(i, 2), Cells(i, 17)).Interior.Color = RGB(255, 255, 255) '' ajout
Cells(i, 17).Value = "" '' ajout
End If '' ajout
End If
Next i
End Sub