Sub Worksheet_Activate()
Cells.ClearContents
Application.ScreenUpdating = False
With Sheets("Feuil1")
DL = .Cells(Cells.Rows.Count, "A").End(xlUp).Row
Range("A1:A" & DL) = .Range("A1:A" & DL).Value
End With
[A:A].RemoveDuplicates Columns:=1, Header:=xlYes
DL = Cells(Cells.Rows.Count, "A").End(xlUp).Row
[B1] = "Sous totaux"
Range("B2:B" & DL).FormulaLocal = "=SOMME.SI(Feuil1!A:A;A2;Feuil1!F:F)"
Cells(DL + 2, "A") = "Total"
Cells(DL + 2, "B").FormulaLocal = "=SOMME(B2:B" & DL & ")"
[A:B].HorizontalAlignment = xlCenter
End Sub