Sub StatsGlob()
Dim r&
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
ShR.Activate
'***************** Calculs avec SUMPRODUCT ************************
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, 1), Cells(r, 1))
Plage.Replace What:="Oui", Replacement:=1, LookAt:=xlPart
Plage.Replace What:="Non", Replacement:=0, LookAt:=xlPart
ShS.Cells(2, 2) = Application.WorksheetFunction.SumProduct(Plage, Plage1) 'Résultat=0
ShS.Cells(2, 2) = Application.WorksheetFunction.SumProduct(Plage.Value, Plage1.Value)
Plage.Replace What:=1, Replacement:="Oui", LookAt:=xlPart
Plage.Replace What:=0, Replacement:="Non", LookAt:=xlPart
End With
'***************** Libération de mémoire ************************
Set ShR = Nothing
Set ShS = Nothing
Set Plage = Nothing
Set Plage1 = Nothing
End Sub