Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
Dim dico As New Dictionary, clef, i&
If Target.Address = [f1].Address Then
For i = 1 To 20
clef = Cells(i, "a").DisplayFormat.Interior.Color
dico(clef) = dico(clef) + Cells(i, "a").Value
Next i
Range("f2:f" & 999).Clear
i = 1
For Each clef In dico.Keys
i = i + 1
Cells(i, "f") = dico(clef)
Cells(i, "f").Interior.Color = clef
Next clef
End If
End Sub