Sub Sum_If()
Dim r&, i&, k&
Dim ShR As Worksheet
Set ShR = ActiveWorkbook.Sheets("R")
Dim ShS As Worksheet
Set ShS = ActiveWorkbook.Sheets("STATS")
Dim Plage As Range
Dim Plage1 As Range
Dim Plage2 As Range
Dim tablo()
For i = 1 To 1 ' 4, nombre de critères
ReDim Preserve tablo(i)
tablo(i) = ShS.Cells(3, 1).Value
Next
With ShR
r = ShR.Cells(65536, 1).End(3).Row
Set Plage = ShR.Range(.Cells(2, 2), .Cells(r, 2))
Set Plage1 = ShR.Range(.Cells(2, 4), .Cells(r, 4))
Set Plage2 = ShR.Range(.Cells(2, 3), .Cells(r, 3))
For k = 1 To UBound(tablo)
ShS.Cells(k + ShS.[c65000].End(xlUp).Row, 3) = Application.WorksheetFunction.SumIfs(Plage, Plage2, tablo(k), Plage1, "bob")
Next
End With
'***************** Libération de mémoire ************************
Set ShR = Nothing
Set ShS = Nothing
Set Plage = Nothing
Set Plage1 = Nothing
End Sub