Option Explicit
Sub Cumul()
Dim dic As Object, i As Long, e, n As Long
Application.ScreenUpdating = False
Set dic = CreateObject("Scripting.Dictionary")
dic.CompareMode = 1
With Feuil2
With .Range("a1", .Range("a" & Rows.Count).End(xlUp)).Resize(, 15)
For i = 2 To .Rows.Count
If Not dic.exists(.Cells(i, 6).Value) Then
Set dic(.Cells(i, 6).Value) = .Rows(1)
End If
Set dic(.Cells(i, 6).Value) = _
Union(dic(.Cells(i, 6).Value), .Rows(i))
Next
End With
End With
With Feuil3
.Cells.Clear
For Each e In dic
n = n + 1
dic(e).Copy .Cells(n, 1)
With .Cells(n, 1).CurrentRegion
With .Offset(.Rows.Count).Resize(1)
dic(e).Rows(1).Copy .Cells(1)
.Columns("a:o").ClearContents
.Columns("a:o").Interior.ColorIndex = 19
.Columns("a:o").Value = _
Array("TOTAL", "-", "-", "=counta(r" & n + 1 & "c:r[-1]c)", "-", e, "=sum(r" & n + 1 & "c:r[-1]c)", "-", "-", "-", "-", "-", "-", "-", "-")
End With
n = n + .Rows.Count + 1
End With
Next
'.Cells.EntireColumn.AutoFit
.Activate
End With
Set dic = Nothing
Application.ScreenUpdating = True
End Sub