Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
ra ra is offline
external usenet poster
 
Posts: 27
Default Pivot table Field Setting Number Format

Hello All,

Is there a way to globally define number formats in a Pivot table?
I'm familiar with going Pivot Table--Field Settings--Number, but
that only sets the format for a column.
I would like to be able to set one number format to apply to all
columns in a table.


Is this possible?

thanks and regards

Richard
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,480
Default Pivot table Field Setting Number Format

Hi Richard

Don't format the columns.
Right click on PTWizardLayoutDouble click the Data Field(s))Number
Format

The number format will be applied to all columns holding that data, as well
as the Grand Totals.

If using XL2007, just right click on any cell in the data areaNumberFormat
--
Regards
Roger Govier

"ra" wrote in message
...
Hello All,

Is there a way to globally define number formats in a Pivot table?
I'm familiar with going Pivot Table--Field Settings--Number, but
that only sets the format for a column.
I would like to be able to set one number format to apply to all
columns in a table.


Is this possible?

thanks and regards

Richard


  #3   Report Post  
Posted to microsoft.public.excel.programming
ra ra is offline
external usenet poster
 
Posts: 27
Default Pivot table Field Setting Number Format

On 3 Mar, 17:44, "Roger Govier" <roger@technology4unospamdotcodotuk
wrote:
Hi Richard

Don't format the columns.
Right click on PTWizardLayoutDouble click the Data Field(s))Number
Format

The number format will be applied to all columns holding that data, as well
as the Grand Totals.

If using XL2007, just right click on any cell in the data areaNumberFormat
--
Regards
Roger Govier

"ra" wrote in message

...



Hello All,


Is there a way to globally define number formats in a Pivot table?
I'm familiar with going Pivot Table--Field Settings--Number, but
that only sets the format for a column.
I would like to be able to set one number format to apply to all
columns in a table.


Is this possible?


thanks and regards


Richard- Hide quoted text -


- Show quoted text -


Thanks for your response Roger. I understand how to format the Data
Feilds as per your instruction however if I have 50 Data feilds can I
Format all without Double Clicking on each individual one?
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,480
Default Pivot table Field Setting Number Format

Hi

It can only be done with VBA for all data fields.
Below is a modification of some code from Debra Dalgleish, which sets each
data field to be Sum, and I have added number format to it as well.

Sub SumAllValueFields()
Dim pt As PivotTable
Dim pf As PivotField
Dim ws As Worksheet

Set ws = ActiveSheet
Set pt = ws.PivotTables(1)
Application.ScreenUpdating = False

pt.ManualUpdate = True
For Each pf In pt.DataFields
pf.Function = xlSum
pf.NumberFormat = "#,##0.00"
Next pf
pt.ManualUpdate = False

Application.ScreenUpdating = True
End Sub

Amend the number format to suit your requirement.

Copy the Code
Alt+F11 to invoke the VB Editor
Insert Module
Paste code into large white pane that appears
Alt+F11 to return to Excel
Navigate to Sheet with your PTAlt+F8Select macro SumAllValueFieldsRun
--
Regards
Roger Govier

"ra" wrote in message
...
On 3 Mar, 17:44, "Roger Govier" <roger@technology4unospamdotcodotuk
wrote:
Hi Richard

Don't format the columns.
Right click on PTWizardLayoutDouble click the Data Field(s))Number
Format

The number format will be applied to all columns holding that data, as
well
as the Grand Totals.

If using XL2007, just right click on any cell in the data
areaNumberFormat
--
Regards
Roger Govier

"ra" wrote in message

...



Hello All,


Is there a way to globally define number formats in a Pivot table?
I'm familiar with going Pivot Table--Field Settings--Number, but
that only sets the format for a column.
I would like to be able to set one number format to apply to all
columns in a table.


Is this possible?


thanks and regards


Richard- Hide quoted text -


- Show quoted text -


Thanks for your response Roger. I understand how to format the Data
Feilds as per your instruction however if I have 50 Data feilds can I
Format all without Double Clicking on each individual one?


  #5   Report Post  
Posted to microsoft.public.excel.programming
ra ra is offline
external usenet poster
 
Posts: 27
Default Pivot table Field Setting Number Format

On 4 Mar, 15:42, "Roger Govier" <roger@technology4unospamdotcodotuk
wrote:
Hi

It can only be done with VBA for all data fields.
Below is a modification of some code from Debra Dalgleish, which sets each
data field to be Sum, and I have added number format to it as well.

Sub SumAllValueFields()
* Dim pt As PivotTable
* Dim pf As PivotField
* Dim ws As Worksheet

* Set ws = ActiveSheet
* Set pt = ws.PivotTables(1)
* Application.ScreenUpdating = False

* * pt.ManualUpdate = True
* * For Each pf In pt.DataFields
* * * pf.Function = xlSum
* * * pf.NumberFormat = "#,##0.00"
* * Next pf
* * pt.ManualUpdate = False

* Application.ScreenUpdating = True
End Sub

Amend the number format to suit your requirement.

Copy the Code
Alt+F11 to invoke the VB Editor
Insert Module
Paste code into large white pane that appears
Alt+F11 to return to Excel
Navigate to Sheet with your PTAlt+F8Select macro SumAllValueFieldsRun
--
Regards
Roger Govier

"ra" wrote in message

...



On 3 Mar, 17:44, "Roger Govier" <roger@technology4unospamdotcodotuk
wrote:
Hi Richard


Don't format the columns.
Right click on PTWizardLayoutDouble click the Data Field(s))Number
Format


The number format will be applied to all columns holding that data, as
well
as the Grand Totals.


If using XL2007, just right click on any cell in the data
areaNumberFormat
--
Regards
Roger Govier


"ra" wrote in message


....


Hello All,


Is there a way to globally define number formats in a Pivot table?
I'm familiar with going Pivot Table--Field Settings--Number, but
that only sets the format for a column.
I would like to be able to set one number format to apply to all
columns in a table.


Is this possible?


thanks and regards


Richard- Hide quoted text -


- Show quoted text -


Thanks for your response Roger. I understand how to format the Data
Feilds as per your instruction however if I have 50 Data feilds can I
Format all without Double Clicking on each individual one?- Hide quoted text -


- Show quoted text -


Excellent, that works perfectly. Many thanks!!


  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Pivot table Field Setting Number Format

On Mar 4, 10:42*am, "Roger Govier"
<roger@technology4unospamdotcodotuk wrote:
Hi

It can only be done with VBA for all data fields.
Below is a modification of some code from Debra Dalgleish, which sets each
data field to be Sum, and I have added number format to it as well.

Sub SumAllValueFields()
* Dim pt As PivotTable
* Dim pf As PivotField
* Dim ws As Worksheet

* Set ws = ActiveSheet
* Set pt = ws.PivotTables(1)
* Application.ScreenUpdating = False

* * pt.ManualUpdate = True
* * For Each pf In pt.DataFields
* * * pf.Function = xlSum
* * * pf.NumberFormat = "#,##0.00"
* * Next pf
* * pt.ManualUpdate = False

* Application.ScreenUpdating = True
End Sub

Amend the number format to suit your requirement.

Copy the Code
Alt+F11 to invoke the VB Editor
Insert Module
Paste code into large white pane that appears
Alt+F11 to return to Excel
Navigate to Sheet with your PTAlt+F8Select macro SumAllValueFieldsRun
--
Regards
Roger Govier

"ra" wrote in message

...



On 3 Mar, 17:44, "Roger Govier" <roger@technology4unospamdotcodotuk
wrote:
Hi Richard


Don't format the columns.
Right click on PTWizardLayoutDouble click the Data Field(s))Number
Format


The number format will be applied to all columns holding that data, as
well
as the Grand Totals.


If using XL2007, just right click on any cell in the data
areaNumberFormat
--
Regards
Roger Govier


"ra" wrote in message


....


Hello All,


Is there a way to globally define number formats in a Pivot table?
I'm familiar with going Pivot Table--Field Settings--Number, but
that only sets the format for a column.
I would like to be able to set one number format to apply to all
columns in a table.


Is this possible?


thanks and regards


Richard- Hide quoted text -


- Show quoted text -


Thanks for your response Roger. I understand how to format the Data
Feilds as per your instruction however if I have 50 Data feilds can I
Format all without Double Clicking on each individual one?- Hide quoted text -


- Show quoted text -


I just came accross this post and it worked great for me too! Exactly
what I was looking for...thanks again!
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
Pivot Table - NUMBER FORMAT option does not appear in field settin cmgedc Excel Discussion (Misc queries) 3 November 5th 08 12:52 AM
Changing a field setting in a pivot table The Rook[_2_] Excel Discussion (Misc queries) 3 September 5th 08 05:29 PM
Setting default pivot table field setting to "sum" Mr. Moose Excel Discussion (Misc queries) 2 December 21st 04 04:43 PM
Setting Pivot Table Page Field Names using VBA Ron McCormick[_2_] Excel Programming 1 November 7th 03 12:45 PM
Setting Pivot Table Page Field Names using VBA Ron McCormick[_2_] Excel Programming 0 November 7th 03 10:35 AM


All times are GMT +1. The time now is 03:28 PM.

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

About Us

"It's about Microsoft Excel"