Sub NomColStock() '1
Dim DerL As Long
Init_Feuilles 'mis pour essai
DerL = WsDC.Range("c" & Rows.Count).End(xlUp).Row
WsDC.Range("c2:c" & DerL).Name = "ColC" 'article
WsDC.Range("d2:d" & DerL).Name = "ColD" 'q
End Sub
Sub UpdateStock() '2
Dim L As Long, DerL As Long
Init_Feuilles 'mis pour essai
With WsStock
DerL = .Range("c" & Rows.Count).End(xlUp).Row
tbl = .Range("A2:O" & DerL)
For L = 1 To UBound(tbl)
tbl(L, 9) = tbl(L, 9) - Evaluate("SumIf(colc,""" & tbl(i, 3) & """, cold)")
tbl(i, 11) = tbl(i, 5) - tbl(i, 9) '.Range("e" & x) - .Range("i" & x)
' If .Range("k" & x) <= 0 Then .Range("l" & x) = .Range("k" & x)
If tbl(i, 11) <= 0 Then tbl(i, 12) = tbl(i, 11)
Next x
.Range("A2").Resize(UBound(tbl, 1), UBound(tbl, 2)) = tbl
End With
End Sub '.Range("i" & x)'.Range("k" & x)