Private Sub Worksheet_Activate()
Worksheet_Change [A1] 'lance la macro
End Sub
Private Sub Worksheet_Change(ByVal Target As Range)
Application.ScreenUpdating = False
Application.EnableEvents = False 'désactive les évènements
[B1].Name = "An" 'cellule nommée
With [Tableau1].ListObject.Range 'tableau structuré
Columns("D").Resize(, .Columns.Count).Clear 'RAZ
.Cells(2, 26) = "=YEAR(A2)=An" 'critère
.AdvancedFilter xlFilterCopy, .Cells(1, 26).Resize(2), [D1] 'filtre avancé
.Cells(2, 26) = ""
End With
Rows(1).Font.Bold = True 'gras
Application.EnableEvents = True 'réactive les évènements
End Sub