Private Sub Worksheet_Change(ByVal Target As Range)
'ligne de titres en ligne 1
Dim r As Range, c1 As Range, c2 As Range, i&, n&
Set r = Intersect([K:K,R:R,S:S], Rows("2:" & Rows.Count))
Set r = Intersect(Target, r, Me.UsedRange)
If Not r Is Nothing Then
Application.EnableEvents = False 'désactive les événements
For Each r In r 'si plusieurs cellules
Set c1 = Cells(r.Row, "K"): Set c2 = Cells(r.Row, "R")
If Not IsDate(c1) Then c1 = ""
If IsDate(c2) Then If c2 < c1 Then c2 = ""
If IsDate(c2) Then
While Weekday(c2, 2) > 5 Or _
Application.CountIf([Fériés], c2) 'si le jour n'est pas ouvré
c2 = c2 + 1
Wend
If IsDate(c1) Then 'nombre de jours ouvrés
For i = Int(c1) To Int(c2)
If Weekday(i, 2) < 6 And _
Application.CountIf([Fériés], i) = 0 Then n = n + 1
Next
c2(1, 2) = n 'colonne S
Else
c2(1, 2) = "" 'colonne S
End If
Else
c2 = IIf(IsDate(c1), "Date en attente", "")
c2(1, 2) = "" 'colonne S
End If
Next
Application.EnableEvents = True 'réactive les événements
End If
End Sub