Private Sub Worksheet_Activate()
Dim tablo, ub&, n&, i&, j&
tablo = Feuil1.[A1].CurrentRegion.Resize(, 2)
ub = UBound(tablo)
n = 1
For i = 2 To ub
If tablo(i, 1) <> "" Then
n = n + 1
tablo(n, 1) = tablo(i, 1)
tablo(n, 2) = tablo(i, 2)
For j = i + 1 To ub
If tablo(j, 1) <> "" Then i = j - 1: Exit For
tablo(n, 2) = tablo(n, 2) + tablo(j, 2)
Next j
End If
Next i
'---restitution---
If FilterMode Then ShowAllData 'si la feuille est filtrée
With [A1] '1ère cellule de destination, à adapter
.Resize(n, 2) = tablo
.Offset(n).Resize(Rows.Count - n - .Row + 1, 2).ClearContents 'RAZ en dessous
End With
End Sub