i have a pivot filter where the field ("$$") should equal = "JY"
however, this month the data does not contain any JY, so I want this pivot to show no data
unfortunately, even with this code, it does blank out everything, but always leaves one remaining and thus the pivot is never empty/blank
Set pt = ActiveSheet.PivotTables("misc_jy").PivotFields("$$")
pt.ClearAllFilters
With pt
For Each p In pt.PivotItems
If p.Name = "JY" Then
p.Visible = True
Else
p.Visible = False
End If
Next p
End With
however, this month the data does not contain any JY, so I want this pivot to show no data
unfortunately, even with this code, it does blank out everything, but always leaves one remaining and thus the pivot is never empty/blank
Set pt = ActiveSheet.PivotTables("misc_jy").PivotFields("$$")
pt.ClearAllFilters
With pt
For Each p In pt.PivotItems
If p.Name = "JY" Then
p.Visible = True
Else
p.Visible = False
End If
Next p
End With