Change Pivot Table Field List

  • Thread starter Thread starter S Himmelrich
  • Start date Start date
What version of Excel do you have? I am using Excel 2007 and here's what I
do.

Right click anywhere in the pivot table and say "Show Field List". From
there I can check or uncheck fields I want or do not want to show.

If you right click the pivot table again you can hide that list.
 
I have four pivot views, D Rank, S Rank, B Rank and O Rank. I know
how to add an items as illustrated below below, however removing it
errors when it's actually not there...how do I avoid this is my
question?

ActiveCell.FormulaR1C1 = "Data Completeness Rank"

' if the Pivot field is not showing I error out just below
ActiveSheet.PivotTables("PivotTable1").PivotFields("S
Rank").Orientation _
= xlHidden
ActiveSheet.PivotTables("PivotTable1").PivotFields("B Rank"). _
Orientation = xlHidden
ActiveSheet.PivotTables("PivotTable1").PivotFields("O Rank"). _
Orientation = xlHidden


ActiveSheet.PivotTables("PivotTable1").AddDataField
ActiveSheet.PivotTables( _
"PivotTable1").PivotFields("DC Rank"), "Sum of DC Rank", xlSum
 
You could add a line above that section:
On Error Resume Next

After that section use another line such as:
 
Back
Top