PC Review


Reply
Thread Tools Rate Thread

Debra Dalgleish - Pivot Tables (Change Multiple Page Fields)

 
 
=?Utf-8?B?bW9saW5hcmFt?=
Guest
Posts: n/a
 
      4th May 2007
Hi Debra, I saw the sample spreadsheet on your website and was wondering if
the code could be used if the pivot tables are not based on the same data
but have the same page fields. Is this possible?
--
molinaram
 
Reply With Quote
 
 
 
 
Debra Dalgleish
Guest
Posts: n/a
 
      5th May 2007
That code might cause a problem if the items in the fields are
different. I've uploaded a version that may work better, and could be
used if the field names are different too.

http://www.contextures.com/excelfiles.html

Under PivotTables, look for 'PT0015 - Change Multiple Different Page Fields'

molinaram wrote:
> Hi Debra, I saw the sample spreadsheet on your website and was wondering if
> the code could be used if the pivot tables are not based on the same data
> but have the same page fields. Is this possible?



--
Debra Dalgleish
Contextures
http://www.contextures.com/tiptech.html

 
Reply With Quote
 
=?Utf-8?B?bW9saW5hcmFt?=
Guest
Posts: n/a
 
      5th May 2007
Debra, thank you, I'll take a look at it.

P.S. I love your site and have learned so much from it already. Thank you.

--
molinaram


"Debra Dalgleish" wrote:

> That code might cause a problem if the items in the fields are
> different. I've uploaded a version that may work better, and could be
> used if the field names are different too.
>
> http://www.contextures.com/excelfiles.html
>
> Under PivotTables, look for 'PT0015 - Change Multiple Different Page Fields'
>
> molinaram wrote:
> > Hi Debra, I saw the sample spreadsheet on your website and was wondering if
> > the code could be used if the pivot tables are not based on the same data
> > but have the same page fields. Is this possible?

>
>
> --
> Debra Dalgleish
> Contextures
> http://www.contextures.com/tiptech.html
>
>

 
Reply With Quote
 
=?Utf-8?B?a2x5c2VsbA==?=
Guest
Posts: n/a
 
      15th Jun 2007
Hi Debora,

I went to your website and found one of your pivot samples helpful. It was
the one where you could update page field values on a sheet named “Sales
Pivot” and this caused the field names on your three pivot tables contained
in the sheet “Other Pivots” to change accordingly.

My problem is that I have six pivot tables that are contained in six
individual worksheets. I am attempting to alter the code to reflect this
diffent setup, but I fear that I won’t be successful. I consider myself a
beginner in VBA coding, so an explanation would have to be fairly
straightforward.

However, I realize that you are busy and might not have the time to give me
a complete solution. Any direction would be immensely appreciated! Here is
the code (with extra formatting code omitted) that updates six pivot tables
in a workbook in their respective worksheets.

Sub Main()
Dim PctDone As Single

For Each ws In ThisWorkbook.Worksheets
ws.Unprotect Password:="1111"
Next ws

For Each ws In ActiveWorkbook.Worksheets
For Each pt In ws.PivotTables
pt.PivotCache.MissingItemsLimit = xlMissingItemsNone
pt.PivotCache.Refresh
Next pt
Next ws

Application.Goto reference:="Data_Home"
Selection.QueryTable.Refresh BackgroundQuery:=False

Application.Goto reference:="ALL_HOME"
ActiveSheet.PivotTables("ALL_TABLE").PivotCache.Refresh

Application.Goto reference:="BASE_HOME"
ActiveSheet.PivotTables("BASE_TABLE").PivotCache.Refresh

Application.Goto reference:="IP_HOME"
ActiveSheet.PivotTables("IP_TABLE").PivotCache.Refresh

Application.Goto reference:="CORP_HOME"
ActiveSheet.PivotTables("CORP_TABLE").PivotCache.Refresh

Application.Goto reference:="CBSA_HOME"
ActiveSheet.PivotTables("CBSA_TABLE").PivotCache.Refresh

Application.Goto reference:="IBC_HOME"
ActiveSheet.PivotTables("IBC_TABLE").PivotCache.Refresh

For Each ws In ThisWorkbook.Worksheets
ws.Protect Password:="1111", DrawingObjects:=True, Contents:=True,
Scenarios:=True _
, AllowUsingPivotTables:=False
Next ws

Application.Goto reference:="Summary_Home"
ActiveWorkbook.Save

End Sub

Any help would be appreciated!
Cheers,
Kent Lysell

--
Kent Lysell
Financial Consultant
Ottawa, Ontario
W: 613.943.9098


"Debra Dalgleish" wrote:

> That code might cause a problem if the items in the fields are
> different. I've uploaded a version that may work better, and could be
> used if the field names are different too.
>
> http://www.contextures.com/excelfiles.html
>
> Under PivotTables, look for 'PT0015 - Change Multiple Different Page Fields'
>
> molinaram wrote:
> > Hi Debra, I saw the sample spreadsheet on your website and was wondering if
> > the code could be used if the pivot tables are not based on the same data
> > but have the same page fields. Is this possible?

>
>
> --
> Debra Dalgleish
> Contextures
> http://www.contextures.com/tiptech.html
>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Debra Dalgleish's clearing old items from Pivot Table dropdowns Andrew Microsoft Excel Programming 3 23rd Feb 2008 01:04 AM
Change Multiple Page Fields in two independent Pivot Tables Oleg Microsoft Excel Worksheet Functions 1 18th Jan 2007 01:20 AM
Debra Dalgleish: Pivot Table problem =?Utf-8?B?TGVlIEh1bnRlcg==?= Microsoft Excel Programming 3 20th May 2005 08:38 PM
Multiple Consolidation Ranges - Debra Dalgleish =?Utf-8?B?bmM=?= Microsoft Excel Misc 1 27th Apr 2005 09:01 PM
Question for Debra Dalgleish / Reply to a Pivot Table Question carl Microsoft Excel Worksheet Functions 1 8th Jun 2004 02:46 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:37 PM.