jamescooper
Well-known Member
- Joined
- Sep 8, 2014
- Messages
- 840
Now having created and formatted the pivot table below, I need to filter column "Mileage", to show only "#N/A" what would be the code for that please?
Many thanks.
Many thanks.
Code:
Sub Pivot_Fields()
Dim pvt As PivotTable
Dim pf As PivotField
Dim pi As PivotItem
Set pvt = ActiveSheet.PivotTables("PivotTable1")
pvt.ManualUpdate = False
'Add item to the Report Filter
pvt.PivotFields("Point 1").Orientation = xlRowField
pvt.PivotFields("Point 2").Orientation = xlRowField
pvt.PivotFields("Mileage").Orientation = xlRowField
pvt.RowAxisLayout xlTabularRow
pvt.ColumnGrand = False
pvt.RowGrand = False
pvt.RepeatAllLabels xlRepeatLabels