Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Pivot Data fields - removal of all (value) fields

Hi,

I'm trying to write a macro that removes all items in the "data" field of a
pivot table. To remove a particular field, in this case the field called "Sum
of FP01" you could use a macro such as this:

ActiveSheet.PivotTables("Central").PivotFields("Su m of FP01").Orientation = _
xlHidden

However if you do not have that field in the table it creates and error.

How would I say "remove ANY data from the data field?"

Many thanks, Brad

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 789
Default Pivot Data fields - removal of all (value) fields

Hi

Dim PF as PivotField
With ActiveSheet.PivotTables("Central")
For Each PF In .PivotFields
.Orientation = xlHidden
Next PF
End With

regards
Paul

ActiveSheet.PivotTables("Central").PivotFields("Su m of
FP01").Orientation = _
xlHidden


On Nov 13, 10:24*am, Bradley Searle
wrote:
Hi,

I'm trying to write a macro that removes all items in the "data" field of a
pivot table. To remove a particular field, in this case the field called "Sum
of FP01" you could use a macro such as this:

ActiveSheet.PivotTables("Central").PivotFields("Su m of FP01").Orientation = _
* * * * xlHidden

However if you do not have that field in the table it creates and error.

How would I say "remove ANY data from the data field?"

Many thanks, Brad


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Pivot Data fields - removal of all (value) fields

Thanks for your help Paul!

I think your code will probably take all fields away (not just the
datafields) - but having not tested it I'm not 100%.

I've not tested it because I found a solution - it is:

ActiveSheet.PivotTables("Central").DataPivotField. Orientation = xlHidden

This simply removes all the data fields, leaving row, column and filter
fields in tact.

" wrote:

Hi

Dim PF as PivotField
With ActiveSheet.PivotTables("Central")
For Each PF In .PivotFields
.Orientation = xlHidden
Next PF
End With

regards
Paul

ActiveSheet.PivotTables("Central").PivotFields("Su m of
FP01").Orientation = _
xlHidden


On Nov 13, 10:24 am, Bradley Searle
wrote:
Hi,

I'm trying to write a macro that removes all items in the "data" field of a
pivot table. To remove a particular field, in this case the field called "Sum
of FP01" you could use a macro such as this:

ActiveSheet.PivotTables("Central").PivotFields("Su m of FP01").Orientation = _
xlHidden

However if you do not have that field in the table it creates and error.

How would I say "remove ANY data from the data field?"

Many thanks, Brad



Reply
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
fields names do not show in excel 2007 pivot table fields list marlo17 New Users to Excel 2 December 1st 08 01:25 PM
Data Fields in Pivot Table MichaelR Excel Programming 1 July 24th 08 07:07 PM
Data Fields in Pivot Table MichaelR Excel Discussion (Misc queries) 0 July 22nd 08 06:36 PM
how can I convert data with fields in rows to fields as columns PiyushAg Excel Discussion (Misc queries) 3 July 2nd 07 05:46 AM
number of fields in the row fields in pivot table UT Excel Discussion (Misc queries) 0 April 13th 06 01:17 AM


All times are GMT +1. The time now is 08:32 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"