Set Tablo = ActiveSheet.ListObjects(1)
With Tablo
lastCol = .ListColumns.Count
LastLine = .ListRows.Count
PointInsertion = LastLine - 4
For i = 1 To 6
.ListRows.Add PointInsertion
Next i
.Range(7, 1).Resize(5, 1).Copy Destination:=.Range(PointInsertion + 1, 1)
DebFor = 11
finfor = PointInsertion + 9
formule = "=MAX(0,G6-sumif($F$11:$F$" & finfor & ",SUBSTITUTE([@Semaines],""restantes "","""") &""sur chantier"",G$11:G$" & finfor & "))"
LastLine = .ListRows.Count
.Range(LastLine - 3, 2).Resize(4, lastCol - 1).Formula = formule