Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)
Dim L As Long, Dat1 As Variant, Dat2 As Variant
L = Target.Row
If Target.Rows.Count > 1 Or L < 2 Or Intersect(Target, [B:C]) Is Nothing Then Exit Sub
Dat1 = Cells(L, "B").Value
Dat2 = Cells(L, "C").Value
If IsDate(Dat1) Then
If IsDate(Dat2) Then
Cells(L, "D").Value = Dat2 - Dat1 + 1 & " jour" & IIf(Dat2 > Dat1, "s", "")
Else
Cells(L, "D").Value = "Manque date fin"
End If
Else
If IsDate(Dat2) Then
Cells(L, "D").Value = "Manque date début"
Else
Cells(L, "D").Value = Empty
End If
End If
End Sub