Sub Construit_Table_Graph()
Dim DL%, Citem%, Lsemaine%, Semaine$, Colonne%, L%, Cj%, Tot
[C3:J54].ClearContents
Application.ScreenUpdating = False
Application.Calculation = xlCalculationManual
With Sheets("Feuil1")
DL = .[F65500].End(xlUp).Row
For Citem = 3 To 10 ' Pour chaque item
For Lsemaine = 3 To 54 ' Pour chaque semaine
Semaine = Cells(Lsemaine, "B") ' Quelle est la semaine ?
Colonne = Application.Match(Semaine, .Range("A3:NM3"), 0) ' Où est la semaine dans planning ?
Tot = 0 ' Cumul semaine
For L = 9 + (Citem - 3) To DL Step 11 ' Pour chaque Ligne concernée de feuil1
For Cj = 0 To 6 ' Pour toute Colonne jours de la bonne semaine
Tot = Tot + .Cells(L, Colonne + Cj) ' Faire le cumul
Next Cj
Next L
If Lsemaine = 3 Then ' Si première semaine
Cells(Lsemaine, Citem) = Tot ' Pas de cumul
Else
If Citem = 6 Or Citem = 10 Then ' Si stock
Cells(Lsemaine, Citem) = Tot ' Pas de cumul
Else
Cells(Lsemaine, Citem) = Tot + Cells(Lsemaine - 1, Citem) ' Sinon cumul avec ligne précédente
End If
End If
Next Lsemaine
Next Citem
End With
Application.ScreenUpdating = True
Application.Calculation = xlCalculationAutomatic
End Sub