Sub DateDelai()
Dim tablo() As Variant
Fin = Range("E" & Rows.Count).End(xlUp).Row
If Fin <> 1 Then Range("E2:F" & Fin).ClearContents
tablo = Range("A1").CurrentRegion.Value
For i = UBound(tablo, 1) To LBound(tablo, 1) + 1 Step -1
Stock = tablo(i, 4)
j = i
While Stock > 0
Stock = Stock - tablo(j, 2)
j = j - 1
Wend
tablo(i, 5) = tablo(j + 1, 1)
tablo(i, 6) = tablo(i, 1) - tablo(i, 5) + 1
Next i
Range("E1").Resize(UBound(tablo, 1), 1) = Application.Index(tablo, , 5)
Range("F1").Resize(UBound(tablo, 1), 1) = Application.Index(tablo, , 6)
End Sub