Option Compare Text
Sub SousTotalNonTriéTotCol()
Set f = Sheets("BD")
Set d = CreateObject("Scripting.Dictionary")
Tble = Range("A2:E" & [a65000].End(xlUp).Row) ' Table entrée
Dim TblS(): ReDim TblS(1 To UBound(Tble), 1 To UBound(Tble, 2)) ' Table sortie
For i = LBound(Tble) To UBound(Tble)
If Tble(i, 2) = "Card recharge completion" And Tble(i, 3) = "yes" Then
If d.Exists(Tble(i, 1)) Then
lig = d(Tble(i, 1)) ' Récupération index TblS()
Else
d(Tble(i, 1)) = d.Count + 1: lig = d.Count: TblS(lig, 1) = Tble(i, 1): TblS(lig, 2) = Tble(i, 2)
End If
For c = 4 To UBound(Tble, 2) ' Totalisation numérique
If Tble(i, c) <> "" Then
TblS(lig, c - 1) = TblS(lig, c - 1) + CDbl(Tble(i, c))
End If
Next c
End If
Next i
f.[N2].Resize(d.Count, UBound(TblS, 2) - 1) = TblS
End Sub
Boisgontier