Option Explicit
Sub SupprDoublons()
Dim RngCàG As Range, TCàG(), RngM As Range, TM(), ClnLigAg As New Collection, Ag As String, Le&, Ls&, Lx&, C&
Set RngCàG = ActiveSheet.[C5:G35]
Set RngM = ActiveSheet.[M5:M35]
TCàG = RngCàG.Value
TM = RngM.Value
On Error Resume Next
For Le = 1 To UBound(TCàG, 1)
If IsEmpty(TCàG(Le, 1)) Then
Lx = 0
Else
Ag = TCàG(Le, 1)
On Error Resume Next
Lx = ClnLigAg.Item(Ag): If Err Then Lx = 0
On Error GoTo 0
If Lx = 0 Then ClnLigAg.Add Ls + 1, Ag
End If
If Lx = 0 Then
Ls = Ls + 1
For C = 1 To 5: TCàG(Ls, C) = TCàG(Le, C): Next C
TM(Ls, 1) = TM(Le, 1)
Else
TM(Lx, 1) = TM(Lx, 1) + TM(Le, 1)
End If
Next Le
Do: Ls = Ls + 1: If Ls > UBound(TCàG, 1) Then Exit Do
For C = 1 To 5: TCàG(Ls, C) = Empty: Next C
TM(Ls, 1) = Empty: Loop
RngCàG.Value = TCàG
RngM.Value = TM
End Sub