Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 71
Default pivot tables: changing 'sum of' to 'average of' & cycling through pages

hi... I'd love some pivot table help!

firstly: -

when i add fields to the pivot table (eg, drag in using the wizard), they
are always 'sum of' or 'count of', but i normaly want 'average of' is there
any way to adjust this (ie, change an option in preferences) or is there
some vba i can use to change all the fields in the data area to 'average
of'? whenever i've tried, it always seems to refer to all available fields
rather than those in the pivot-table.

secondly: -

i have collected data from several different production sites and i want to
make several summary pivot tables quickly/easily; can sometime tell me how i
can use vba loop through each site creating a new worksheet of sumary data
for each of the sites?

thanks for any pointers you can give me,

Tim


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,939
Default pivot tables: changing 'sum of' to 'average of' & cycling through

The default when you drag a new dimension onto the table is sum. You can
right click the dimension and select Field Setting and change it to average
(I assume you already knew this). To the best of my knowledge there is no way
to adjust what type of aggregation will be the default. The default is sum
and that is just the way it is...

As for your second question, if I understand you correctly, you want to
create a seperate worksheet for each member in a dimension. The answer
depends on whether you are using xl2000 orlater (pivot tables changed in
xl2002). If you are in 2000 then place the dimension you would like to
cascade in the selection criteria above the table. Right click and select
Show Pages. In xl2002 do the same thing but you select Show Pages from the
pivot table drop down on the pivot table menu.
--
HTH...

Jim Thomlinson


"Tim" wrote:

hi... I'd love some pivot table help!

firstly: -

when i add fields to the pivot table (eg, drag in using the wizard), they
are always 'sum of' or 'count of', but i normaly want 'average of' is there
any way to adjust this (ie, change an option in preferences) or is there
some vba i can use to change all the fields in the data area to 'average
of'? whenever i've tried, it always seems to refer to all available fields
rather than those in the pivot-table.

secondly: -

i have collected data from several different production sites and i want to
make several summary pivot tables quickly/easily; can sometime tell me how i
can use vba loop through each site creating a new worksheet of sumary data
for each of the sites?

thanks for any pointers you can give me,

Tim



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 71
Default pivot tables: changing 'sum of' to 'average of' & cycling through

Jim,

Point 1: yes, you assumed right! It was a 'shot in the dark' that there
would be an easy way of changing the default. I 'm just wondering if anyone
can advise how i can reference each of the chosen fields in the table to
change them to 'average of' - like i said originally, whenever i tried, i
could only actually refer to the available fields, not the chosen ones (i
hope that makes some kind of sense!)

Point 2: Thank you very much... I never knew that! That's exactly what i
wanted!

IDH*,

Tim

* = It Did Help

"Jim Thomlinson" wrote in message
...
The default when you drag a new dimension onto the table is sum. You can
right click the dimension and select Field Setting and change it to

average
(I assume you already knew this). To the best of my knowledge there is no

way
to adjust what type of aggregation will be the default. The default is sum
and that is just the way it is...

As for your second question, if I understand you correctly, you want to
create a seperate worksheet for each member in a dimension. The answer
depends on whether you are using xl2000 orlater (pivot tables changed in
xl2002). If you are in 2000 then place the dimension you would like to
cascade in the selection criteria above the table. Right click and select
Show Pages. In xl2002 do the same thing but you select Show Pages from the
pivot table drop down on the pivot table menu.
--
HTH...

Jim Thomlinson


"Tim" wrote:

hi... I'd love some pivot table help!

firstly: -

when i add fields to the pivot table (eg, drag in using the wizard),

they
are always 'sum of' or 'count of', but i normaly want 'average of' is

there
any way to adjust this (ie, change an option in preferences) or is there
some vba i can use to change all the fields in the data area to 'average
of'? whenever i've tried, it always seems to refer to all available

fields
rather than those in the pivot-table.

secondly: -

i have collected data from several different production sites and i want

to
make several summary pivot tables quickly/easily; can sometime tell me

how i
can use vba loop through each site creating a new worksheet of sumary

data
for each of the sites?

thanks for any pointers you can give me,

Tim





  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,939
Default pivot tables: changing 'sum of' to 'average of' & cycling thro

This code loops through all of the visible fields and attepts to change the
aggregation to average (xl2002)...

Sub test()
Dim pvt As PivotTable
Dim pvf As PivotField

Set pvt = ActiveSheet.PivotTables(1)
On Error Resume Next
For Each pvf In pvt.VisibleFields
pvf.Function = xlAverage
Next pvf
On Error GoTo 0
End Sub
--
HTH...

Jim Thomlinson


"Tim" wrote:

Jim,

Point 1: yes, you assumed right! It was a 'shot in the dark' that there
would be an easy way of changing the default. I 'm just wondering if anyone
can advise how i can reference each of the chosen fields in the table to
change them to 'average of' - like i said originally, whenever i tried, i
could only actually refer to the available fields, not the chosen ones (i
hope that makes some kind of sense!)

Point 2: Thank you very much... I never knew that! That's exactly what i
wanted!

IDH*,

Tim

* = It Did Help

"Jim Thomlinson" wrote in message
...
The default when you drag a new dimension onto the table is sum. You can
right click the dimension and select Field Setting and change it to

average
(I assume you already knew this). To the best of my knowledge there is no

way
to adjust what type of aggregation will be the default. The default is sum
and that is just the way it is...

As for your second question, if I understand you correctly, you want to
create a seperate worksheet for each member in a dimension. The answer
depends on whether you are using xl2000 orlater (pivot tables changed in
xl2002). If you are in 2000 then place the dimension you would like to
cascade in the selection criteria above the table. Right click and select
Show Pages. In xl2002 do the same thing but you select Show Pages from the
pivot table drop down on the pivot table menu.
--
HTH...

Jim Thomlinson


"Tim" wrote:

hi... I'd love some pivot table help!

firstly: -

when i add fields to the pivot table (eg, drag in using the wizard),

they
are always 'sum of' or 'count of', but i normaly want 'average of' is

there
any way to adjust this (ie, change an option in preferences) or is there
some vba i can use to change all the fields in the data area to 'average
of'? whenever i've tried, it always seems to refer to all available

fields
rather than those in the pivot-table.

secondly: -

i have collected data from several different production sites and i want

to
make several summary pivot tables quickly/easily; can sometime tell me

how i
can use vba loop through each site creating a new worksheet of sumary

data
for each of the sites?

thanks for any pointers you can give me,

Tim






  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 71
Default pivot tables: changing 'sum of' to 'average of' & cycling thro

Yep, that works perfectly and I see where i was going wrong

Thanks Jim,

Tim

"Jim Thomlinson" wrote in message
...
This code loops through all of the visible fields and attepts to change

the
aggregation to average (xl2002)...

Sub test()
Dim pvt As PivotTable
Dim pvf As PivotField

Set pvt = ActiveSheet.PivotTables(1)
On Error Resume Next
For Each pvf In pvt.VisibleFields
pvf.Function = xlAverage
Next pvf
On Error GoTo 0
End Sub
--
HTH...

Jim Thomlinson


"Tim" wrote:

Jim,

Point 1: yes, you assumed right! It was a 'shot in the dark' that there
would be an easy way of changing the default. I 'm just wondering if

anyone
can advise how i can reference each of the chosen fields in the table to
change them to 'average of' - like i said originally, whenever i tried,

i
could only actually refer to the available fields, not the chosen ones

(i
hope that makes some kind of sense!)

Point 2: Thank you very much... I never knew that! That's exactly what

i
wanted!

IDH*,

Tim

* = It Did Help

"Jim Thomlinson" wrote in

message
...
The default when you drag a new dimension onto the table is sum. You

can
right click the dimension and select Field Setting and change it to

average
(I assume you already knew this). To the best of my knowledge there is

no
way
to adjust what type of aggregation will be the default. The default is

sum
and that is just the way it is...

As for your second question, if I understand you correctly, you want

to
create a seperate worksheet for each member in a dimension. The answer
depends on whether you are using xl2000 orlater (pivot tables changed

in
xl2002). If you are in 2000 then place the dimension you would like to
cascade in the selection criteria above the table. Right click and

select
Show Pages. In xl2002 do the same thing but you select Show Pages from

the
pivot table drop down on the pivot table menu.
--
HTH...

Jim Thomlinson


"Tim" wrote:

hi... I'd love some pivot table help!

firstly: -

when i add fields to the pivot table (eg, drag in using the wizard),

they
are always 'sum of' or 'count of', but i normaly want 'average of'

is
there
any way to adjust this (ie, change an option in preferences) or is

there
some vba i can use to change all the fields in the data area to

'average
of'? whenever i've tried, it always seems to refer to all available

fields
rather than those in the pivot-table.

secondly: -

i have collected data from several different production sites and i

want
to
make several summary pivot tables quickly/easily; can sometime tell

me
how i
can use vba loop through each site creating a new worksheet of

sumary
data
for each of the sites?

thanks for any pointers you can give me,

Tim










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
Show Pages for Excel 2007 Pivot Tables Jim Georgia Excel Discussion (Misc queries) 5 November 11th 09 03:25 AM
Printing pages from Pivot Tables automatically saltnsnails Excel Discussion (Misc queries) 4 May 9th 08 05:07 PM
Average Calculations from Pivot Tables - Get Pivot Data? Calc Fiel westy Excel Worksheet Functions 5 March 10th 07 01:31 AM
How do I "show pages" in pivot tables in Excel 2002 simon Excel Worksheet Functions 1 October 10th 05 10:15 PM
Excel 2003 Pivot tables - how to "show pages" RosH Excel Discussion (Misc queries) 1 August 9th 05 01:17 PM


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