ich möchte eine Pivot-Tabelle filtern.
Leider funkt`s nicht!
Sub Namen_auswählen()
Dim Pivot_Item As PivotItem
Dim sName As String
sName = "Name 1"
With ActiveSheet.PivotTables("Muster").PivotFields("Artikel")
For Each Pivot_Item In .PivotItems
Pivot_Item.Visible = True
Next
.PivotItems("(blank)").Visible = False
End With
With ActiveSheet.PivotTables("Muster").PivotFields("Name")
For Each Pivot_Item In .PivotItems
' If .PivotItems(sName) = sName Then
If .PivotItems(sName) "" Then
Pivot_Item.Visible = True
Else
.Pivot_Item.Visible = False
End If
Next
End With
End Sub
Danke, für jede Hilfe!Gruß
Olag
https://www.herber.de/bbs/user/129428.xlsm