Option Explicit
Function NombreCoupures(ByVal HDébProd As Double, ByVal HFinProd As Double, ByVal RCoupures As Range) As Double
Dim TC(), L&, HDébC#, HFinC#
TC = RCoupures.Value
For L = 1 To UBound(TC, 1)
HDébC = TC(L, 1): If HDébC < HDébProd Then HDébC = HDébProd
HFinC = TC(L, 2): If HFinC > HFinProd Then HFinC = HFinProd
If HFinC > HDébC Then NombreCoupures = NombreCoupures + 1
Next L
End Function
Function SommeCoupures(ByVal HDébProd As Double, ByVal HFinProd As Double, ByVal RCoupures As Range) As Double
Dim TC(), L&, HDébC#, HFinC#
TC = RCoupures.Value
For L = 1 To UBound(TC, 1)
HDébC = TC(L, 1): If HDébC < HDébProd Then HDébC = HDébProd
HFinC = TC(L, 2): If HFinC > HFinProd Then HFinC = HFinProd
If HFinC > HDébC Then SommeCoupures = SommeCoupures + HFinC - HDébC
Next L
End Function