LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 76
Default Looking to remove pivot fields from pivot table via macro

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").AddDataFiel d
ActiveSheet.PivotTables( _
"PivotTable1").PivotFields("DC Rank"), "Sum of DC Rank",
xlSum
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem inserting calculated pivot fields into Pivot Table (2007) wamiller36 Excel Discussion (Misc queries) 1 March 5th 10 11:40 PM
Macro on filtering pivot table (pivot fields) = debug markx Excel Programming 2 May 28th 08 09:32 AM
Remove grouped items and fields from pivot table Tom Harwell Excel Discussion (Misc queries) 1 February 17th 08 10:06 PM
Pivot Table Macro not inserting all data fields [email protected] Excel Discussion (Misc queries) 0 October 27th 06 04:55 AM
How to remove Drop Page Fields Here from Pivot Table wengyee Excel Discussion (Misc queries) 2 June 3rd 05 10:36 PM


All times are GMT +1. The time now is 01:34 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"