PC Review


Reply
Thread Tools Rate Thread

change pivot table in code

 
 
Basil
Guest
Posts: n/a
 
      24th Nov 2008
Hi,

Does anybody know some example code I can use for the following situation:

I have 2 pivot tables on a sheet which both have the same report filters. If
I change the filter selection on pivot table 1, I want (through code) for
pivot table 2 to automatically apply the same filter selection.

Hope u can help,

Thanks,

Basil
 
Reply With Quote
 
 
 
 
A&A - In Any Place
Guest
Posts: n/a
 
      24th Nov 2008
See this solution in: http://inanyplace.blogspot.com/



ANDRÉ BERNARDES
A&A - In Any Place

Acesse o portfólio:
http://www.slideshare.net/bernardes/...s-presentation

MSN: (E-Mail Removed)
SKYPE: inanyplace
TWITTER: bernardess

My Profile: http://al-bernardes.sites.uol.com.br/
My Blog: http://inanyplace.blogspot.com/
In LinkedIn: http://www.linkedin.com/in/andrebernardes
In Plaxo: http://andrebernardes.myplaxo.com/
In Jobster: http://www.jobster.com/people/andrebernardes
In Unyk: http://www.unyk.com/pt/id/9571234

My experiences:
http://andrelbernardes.sites.uol.com.br/MIS.html
http://andrelbernardes.sites.uol.com.br/XLS.html

Acesse meus Feeds:
http://www.google.com/reader/shared/...57110218427555


"Basil" wrote:

> Hi,
>
> Does anybody know some example code I can use for the following situation:
>
> I have 2 pivot tables on a sheet which both have the same report filters. If
> I change the filter selection on pivot table 1, I want (through code) for
> pivot table 2 to automatically apply the same filter selection.
>
> Hope u can help,
>
> Thanks,
>
> Basil

 
Reply With Quote
 
Basil
Guest
Posts: n/a
 
      24th Nov 2008
Hi Andre,

Thanks for your response. I couldn't find the solution there (although my
spanish isn't perfect). I only saw the blog on how to refresh all pivot
tables (which I actually already do in a different way by using
activeworkbook.refreshall).

I need code to change the filter on pivot table 2 when a user changes the
filter on pivot table 1.

Thanks,

Basil

"A&A - In Any Place" wrote:

> See this solution in: http://inanyplace.blogspot.com/
>
>
>
> ANDRÉ BERNARDES
> A&A - In Any Place
>
> Acesse o portfólio:
> http://www.slideshare.net/bernardes/...s-presentation
>
> MSN: (E-Mail Removed)
> SKYPE: inanyplace
> TWITTER: bernardess
>
> My Profile: http://al-bernardes.sites.uol.com.br/
> My Blog: http://inanyplace.blogspot.com/
> In LinkedIn: http://www.linkedin.com/in/andrebernardes
> In Plaxo: http://andrebernardes.myplaxo.com/
> In Jobster: http://www.jobster.com/people/andrebernardes
> In Unyk: http://www.unyk.com/pt/id/9571234
>
> My experiences:
> http://andrelbernardes.sites.uol.com.br/MIS.html
> http://andrelbernardes.sites.uol.com.br/XLS.html
>
> Acesse meus Feeds:
> http://www.google.com/reader/shared/...57110218427555
>
>
> "Basil" wrote:
>
> > Hi,
> >
> > Does anybody know some example code I can use for the following situation:
> >
> > I have 2 pivot tables on a sheet which both have the same report filters. If
> > I change the filter selection on pivot table 1, I want (through code) for
> > pivot table 2 to automatically apply the same filter selection.
> >
> > Hope u can help,
> >
> > Thanks,
> >
> > Basil

 
Reply With Quote
 
Basil
Guest
Posts: n/a
 
      27th Nov 2008
I did it eventally. It seems that Excel 2003 onwards can have issues with
this. My code was correct in the first place but I had to rebuild everything.
Also although I would assume that I could reference the current page of one
pivot table to set the current page of the other pivot table, Excel coud not
get it, so I had to reference a cell that pointed at the current page of the
pivot table:

If Range("Piv_Sport") <> Range("Piv_Sport_Check") Then
Range("Piv_Sport_Check") = Range("Piv_Sport")
ActiveSheet.PivotTables("Weekly").PivotFields("Sport").CurrentPage =
Range("Piv_Sport").Value
Else
Range("Piv_Market_Check") = Range("Piv_Market")
ActiveSheet.PivotTables("Weekly").PivotFields("Market
Search").CurrentPage = Range("Piv_Market").Value
End If

Basil

"Basil" wrote:

> Hi Andre,
>
> Thanks for your response. I couldn't find the solution there (although my
> spanish isn't perfect). I only saw the blog on how to refresh all pivot
> tables (which I actually already do in a different way by using
> activeworkbook.refreshall).
>
> I need code to change the filter on pivot table 2 when a user changes the
> filter on pivot table 1.
>
> Thanks,
>
> Basil
>
> "A&A - In Any Place" wrote:
>
> > See this solution in: http://inanyplace.blogspot.com/
> >
> >
> >
> > ANDRÉ BERNARDES
> > A&A - In Any Place
> >
> > Acesse o portfólio:
> > http://www.slideshare.net/bernardes/...s-presentation
> >
> > MSN: (E-Mail Removed)
> > SKYPE: inanyplace
> > TWITTER: bernardess
> >
> > My Profile: http://al-bernardes.sites.uol.com.br/
> > My Blog: http://inanyplace.blogspot.com/
> > In LinkedIn: http://www.linkedin.com/in/andrebernardes
> > In Plaxo: http://andrebernardes.myplaxo.com/
> > In Jobster: http://www.jobster.com/people/andrebernardes
> > In Unyk: http://www.unyk.com/pt/id/9571234
> >
> > My experiences:
> > http://andrelbernardes.sites.uol.com.br/MIS.html
> > http://andrelbernardes.sites.uol.com.br/XLS.html
> >
> > Acesse meus Feeds:
> > http://www.google.com/reader/shared/...57110218427555
> >
> >
> > "Basil" wrote:
> >
> > > Hi,
> > >
> > > Does anybody know some example code I can use for the following situation:
> > >
> > > I have 2 pivot tables on a sheet which both have the same report filters. If
> > > I change the filter selection on pivot table 1, I want (through code) for
> > > pivot table 2 to automatically apply the same filter selection.
> > >
> > > Hope u can help,
> > >
> > > Thanks,
> > >
> > > Basil

 
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
How Do I Change Two Pivot Table Page Selections with VBA Code dmarsh Microsoft Excel Programming 1 28th Jul 2009 03:42 PM
VBA code to change matrix to list for Pivot table Analysis Martin Microsoft Excel Programming 2 17th May 2009 03:22 PM
Pivot Table Page Change Code PFLY Microsoft Excel Misc 1 16th May 2008 12:42 AM
Code that will rerun or refresh a pivot table (after new data ispasted into the original Pivot Table's Source Range) Mike C Microsoft Excel Programming 3 15th Feb 2008 06:22 AM
Pivot Tables - change flat file data from the pivot table Mark Microsoft Excel Worksheet Functions 2 18th Nov 2003 08:26 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:43 AM.