Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address <> "$C$1" Then Exit Sub
If Me.AutoFilter.FilterMode Then Me.ShowAllData
If Target = "" Or Target = "Libellé" Then Exit Sub
Application.ScreenUpdating = False
[A4].CurrentRegion.AutoFilter Field:=2, Criteria1:=Target
Dim tabCol()
With Sheets("Feuille2")
ligneFam = Application.Match(Target, .[A:A], 0)
For col = 3 To 12
If .Cells(ligneFam, col) <> "" Then
ReDim Preserve tabCol(x)
tabCol(x) = Application.Match(.Cells(ligneFam, col), [4:4], 0)
x = x + 1
End If
Next col
End With
On Error GoTo fin
test = UBound(tabCol)
Columns("M:FB").EntireColumn.Hidden = True
For c = 0 To UBound(tabCol)
Cells(1, tabCol(c)).EntireColumn.Hidden = False
Next c
fin:
Application.ScreenUpdating = True
End Sub