Function HeuresRoute(R As Range, limite As Byte, forfait As Boolean)
Dim ncol%, nlig&, i&, s&
ncol = R.Columns.Count
nlig = R.Rows.Count
For i = 1 To nlig
If IsDate(R(i, 1)) Then
If Weekday(R(i, 1)) = 1 Or i = nlig Then
If forfait Then s = limite * IIf(s > 0, 1, 0) Else If s > limite Then s = limite
HeuresRoute = HeuresRoute + s
s = 0
End If
s = s + Sgn(R(i, ncol))
End If
Next
End Function