Hi,
can someone help me, i have a code dto loop through only selected items in report filter of a pivot table, instead of using only selected item, the code use all items either selected not selected. I have search through net and use the visible element of the PivotItems.visible= true, both not working. Pls very urgent if someone can help
attached is the piece of my code
can someone help me, i have a code dto loop through only selected items in report filter of a pivot table, instead of using only selected item, the code use all items either selected not selected. I have search through net and use the visible element of the PivotItems.visible= true, both not working. Pls very urgent if someone can help
attached is the piece of my code
Code:
If ActiveSheet.PivotTables("PivotTable1").PivotFields("Node").EnableMultiplePageItems = True Then
For x = 5 To lastrow
For i = 1 To ActiveSheet.PivotTables("PivotTable1").PivotFields("Node").PivotItems.Count
If ActiveSheet.PivotTables("PivotTable1").PivotFields("Node").PivotItems(i).Visible = True Then
If ActiveSheet.PivotTables("PivotTable1").PivotFields("Node").PivotItems(i).Value = Sheets("CurrentReport").Range("j" & x) Then 'if selected then
If secAvailable(Sheets("CurrentReport").Range("k" & x)) Then
Total = Total + Val(Sheets("CurrentReport").Range("f" & x))
End If
End If
End If
Next i
Next x
End If
Last edited by a moderator: