Dine
01-18-2016, 08:26 AM
Hi Friends,
Have written a code for a Pivot table having "Description" in report filter as one of the criteria.The ask is the "Description" in the report filter column should not select the below:
Any description containing words :
1. IIT
2 I&IT
3.Device Monitoring - No Issues Reported
Have been successful for the first 2 conditions and been failing for the last condition.
<<<<>>>>
-------------------------------------------------------------------------------------------------------------------
Sub pt1()
Dim pt As PivotTable
Set pt = ActiveSheet.PivotTables("Pttest1")
For Each descpi In pt.PivotFields("Description").PivotItems
If InStr(descpi, "I&IT") > 0 Or InStr(descpi, "IIT") > 0 Or InStr(descpi, "Device Monitoring - No Issues Reported") > 0 Then
descpi.Visible = False
Else
descpi.Visible = True
End If
Next descpi
End Sub
Have written a code for a Pivot table having "Description" in report filter as one of the criteria.The ask is the "Description" in the report filter column should not select the below:
Any description containing words :
1. IIT
2 I&IT
3.Device Monitoring - No Issues Reported
Have been successful for the first 2 conditions and been failing for the last condition.
<<<<>>>>
-------------------------------------------------------------------------------------------------------------------
Sub pt1()
Dim pt As PivotTable
Set pt = ActiveSheet.PivotTables("Pttest1")
For Each descpi In pt.PivotFields("Description").PivotItems
If InStr(descpi, "I&IT") > 0 Or InStr(descpi, "IIT") > 0 Or InStr(descpi, "Device Monitoring - No Issues Reported") > 0 Then
descpi.Visible = False
Else
descpi.Visible = True
End If
Next descpi
End Sub