Bonjour,

Je bloque sur un code afin de fixer les colonnes d'un tableau dynamique de fait que lorsqu'on filtre et que l'une des colonnes ne contient pas de valeurs, on est quand meme la colonne affichee.
Voici mon code:

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
Sub test()
Dim p As PivotItem
Application.ScreenUpdating = False
Set PivotTableIndic = ThisWorkbook.Worksheets("TableIndic").PivotTables("PivotTableIndic")
Set PivotTableRatio = ThisWorkbook.Worksheets("Prediction").PivotTables("PivotTableRatio")
 
With PivotTableRatio.PivotFields("movement Type")
    For Each p In .PivotItems
    If p.Value = "(blank)" Then p.Visible = False Else p.Visible = True
 
    Next p
End With
Application.ScreenUpdating = True
End Sub
Merci pour votre aide.