Sub Stat2D()
Set d1 = CreateObject("Scripting.Dictionary")
Set d2 = CreateObject("Scripting.Dictionary")
Dim a(1 To 100, 1 To 100)
Dim t1(1 To 100)
Dim t2(1 To 100)
lig = 1
col = 1
Mlig = lig
Mcol = col
For Each c In Range("a2:a" & [A65000].End(xlUp).Row)
'========Début code non compris
If d1.exists(c.Value) Then lig = d1(c.Value) Else d1(c.Value) = Mlig: lig = Mlig: Mlig = Mlig + 1 comprise
tmp = c.Offset(, 1)
If d2.exists(tmp) Then col = d2(tmp) Else d2(tmp) = Mcol: col = Mcol: Mcol = Mcol + 1
'=========Fin code non compris
a(lig, col) = a(lig, col) + c.Offset(, 2)
t1(lig) = t1(lig) + c.Offset(, 2)
t2(col) = t2(col) + c.Offset(, 2)
Next c
[f2].Resize(d1.Count, 1) = Application.Transpose(d1.keys)
[g1].Resize(1, d2.Count) = d2.keys
[g2].Resize(d1.Count, d2.Count) = a
[f2].Offset(d1.Count, 1).Resize(, d2.Count) = t2
[g2].Offset(, d2.Count).Resize(d1.Count) = Application.Transpose(t1)
End Sub