Sub AI_G_MACRO()
Dim WS As Worksheet, PT As PivotTable, PF As PivotField, PI As PivotItem
ActiveSheet.PivotTables("TCD1").PivotFields("GROUPE").ClearAllFilters
Set WS = Sheets("PAGE")
Set PT = WS.PivotTables("TCD1")
Set PF = PT.PivotFields("GROUPE")
For Each PI In PF.PivotItems
PI.Visible = False
If PI.Name Like "*_GROUPE_VIL_*" Then
PI.Visible = True
End If
On Error Resume Next
Next
If PI.Name Like "*_GROUPE_LOL_*" Then
PI.Visible = True
End If
On Error Resume Next
Next
ActiveSheet.PivotTables("TCD2").PivotFields("GROUPE").ClearAllFilters
Set WS = Sheets("PAGE")
Set PT = WS.PivotTables("TCD2")
Set PF = PT.PivotFields("GROUPE")
For Each PI In PF.PivotItems
PI.Visible = False
If PI.Name Like "*_GROUPE_VIL_*" Then
PI.Visible = True
End If
On Error Resume Next
Next
If PI.Name Like "*_GROUPE_LOL_*" Then
PI.Visible = True
End If
On Error Resume Next
Next
End Sub