Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)
Dim Rng As Range, Zon As Range, T(), L&, Trop#, TotDisp#
If Target.Rows.Count > 1 Or Target.Columns.Count > 1 Then Exit Sub
If Intersect([C11:C30,K11:K30], Target) Is Nothing Then Exit Sub
Set Rng = Me.[C11:C30,J11:J30]
TotDisp = Me.[L9].Value
Trop = -Me.[K30].Value
If Trop <= 0 Then Exit Sub
If MsgBox(Trop & " heure(s) spécifiée(s) en trop vont être annulées.", vbOKCancel, Me.Name) = vbCancel Then Exit Sub
For Each Zon In Rng.Areas
T = Zon.Value
For L = 1 To UBound(T, 1)
If T(L, 1) > TotDisp Then T(L, 1) = TotDisp
TotDisp = TotDisp - T(L, 1): Next L
Application.EnableEvents = False
Zon.Value = T
Application.EnableEvents = True: Next Zon
End Sub