I have a PT that gets filtered which reduces the volume of items based on the unfiltered PT.
For the remaining pivot items, I need to establish the text string if each pivot item.
using the following, the loop looks at ALL items in the PT rather than the ones that remain after a filter has been applied
Is there a way of establishing if the pivot item is visible as all pivot items, even when filtered out, show as TRUE for the .Visible property.
TIA
For the remaining pivot items, I need to establish the text string if each pivot item.
using the following, the loop looks at ALL items in the PT rather than the ones that remain after a filter has been applied
VBA Code:
With Sheets("Pivot Tables").PivotTables("ptRunDetails")
.PivotFields("Run").CurrentPage = strRun
For Each ptItem In .PivotFields("Product Code").PivotItems
strPC = ptItem
strType = WorksheetFunction.XLookup(strPC, Range("Products_ColProductCode"), Range("Products_ColProductType"))
If strType = "Admin" Or strType = "WASTE" Then
ptItem.Visible = False
Else
ptItem.Visible = True
End If
Next
End With
TIA