Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 70
Default Changing a field setting in a pivot table

I have a pivot table which contains approx 300 columns which have all
defaulted to 'COUNT' I am wanting to change them ALL to sum, but it onlys
seems to let me do it one by one.

Is there anyway of doing it in bulk?
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default Changing a field setting in a pivot table

You could create your own macro or even use Debra Dalgleish's PivotPower Add-in:
http://contextures.com/xlPivotAddIn02.html#PivotItems



The Rook wrote:

I have a pivot table which contains approx 300 columns which have all
defaulted to 'COUNT' I am wanting to change them ALL to sum, but it onlys
seems to let me do it one by one.

Is there anyway of doing it in bulk?


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 70
Default Changing a field setting in a pivot table

Thanks,

Worked perfectly

The Rook

"Dave Peterson" wrote:

You could create your own macro or even use Debra Dalgleish's PivotPower Add-in:
http://contextures.com/xlPivotAddIn02.html#PivotItems



The Rook wrote:

I have a pivot table which contains approx 300 columns which have all
defaulted to 'COUNT' I am wanting to change them ALL to sum, but it onlys
seems to let me do it one by one.

Is there anyway of doing it in bulk?


--

Dave Peterson

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,480
Default Changing a field setting in a pivot table

Hi

The default in the PT is COUNT, if data in the column is Text or Blank.
I suspect you have defined a very large range for your PT, to allow for
future data entry, which would then cause the PT to default to Count.
If you create a Dynamic Range and give this as the source, then that should
get rid of your problem

InsertNameDefine Name myData refers to
=$A$1:INDEX($1:$65536,COUNTA($A:$A),COUNTA($1:$1))
For the PT, set Source=myData

To change all the fields from Count to Sum, then use the following code
(from Debra Dalgleish)
Sub ChangetoSum()
Dim pt As PivotTable, pf As PivotField, ws As Worksheet, i As Long
Application.ScreenUpdating = False
Set ws = ActiveSheet
For i = 1 To ws.PivotTables.Count
Set pt = ws.PivotTables(i)
pt.ManualUpdate = True
For Each pf In pt.DataFields
pf.Function = xlSum
Next
pt.ManualUpdate = False
Next i
Application.ScreenUpdating = True
End Sub

Copy the Code above
Alt+F11 to invoke the VB Editor
InsertModule
Paste code into white pane that appears
Alt+F11 to return to Excel

To use
Select sheet containing the PT's
Alt+F8 to bring up Macros
Highlight ChangeToSum
Run


--
Regards
Roger Govier

"The Rook" wrote in message
...
I have a pivot table which contains approx 300 columns which have all
defaulted to 'COUNT' I am wanting to change them ALL to sum, but it onlys
seems to let me do it one by one.

Is there anyway of doing it in bulk?


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
Changing field names without affecting pivot table csdjj Excel Discussion (Misc queries) 2 April 15th 08 05:16 PM
sum a pivot table field as a calulated field Jerome Excel Discussion (Misc queries) 0 January 4th 08 02:24 PM
Pivit table- cell on spread sheet referencing pivot table field David M Charts and Charting in Excel 2 August 18th 07 07:46 PM
How to make a field created a part of the Pivot Table Field List? drhell Excel Discussion (Misc queries) 0 January 29th 07 11:13 PM
Setting default pivot table field setting to "sum" Mr. Moose Excel Discussion (Misc queries) 2 December 21st 04 04:43 PM


All times are GMT +1. The time now is 11:54 PM.

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"