Truth_Is_A_Person
New Member
- Joined
- May 24, 2018
- Messages
- 3
here is my code that used to work, but for some reason now, it is not hiding the detail...
essentially i am checking the Percent executed in column B and if it is 100 then hide the detail, if it is any other value then show the detail.
Code:
For r = TopOfPivotTable To BottomOfPivotTable
If Cells(r, 2).Value = "1" Then
fname = Cells(r, 1).PivotField.Name
Worksheets("Execution for RCA").PivotTables("PivotTable4").PivotFields(fname).PivotItems(Cells(r, 1).Text).ShowDetail = False
Else
fname = Cells(r, 1).PivotField.Name
Worksheets("Execution for RCA").PivotTables("PivotTable4").PivotFields(fname).PivotItems(Cells(r, 1).Text).ShowDetail = True
End If
'double check incase the bottom row changes
If InStr(Cells(r + 1, 1).Text, "Grand") Then Exit For
Next r