Solved

Pivot table question

Posted on 2011-09-28
2
186 Views
Last Modified: 2012-06-27
I have 3 pivot tables.  How would I programmatically refresh all 3
pivot tables to where they refresh individually?  As in I want the 1st
one to finish refreshing before the 2nd begins to refresh, and I want
the 2nd one to finish refreshing before the 3rd one begins to refresh?


0
Comment
Question by:tkrpata
2 Comments
 
LVL 12

Accepted Solution

by:
telyni19 earned 500 total points
ID: 36719452
Does something like the attached code not work for you? Refreshing each table in turn should do so sequentially. If need be, you could put in a wait statement in between each Refresh statement like this one:
Application.Wait (Now() + "00:00:02") 'Waits two seconds

This one statement will also refresh every pivot table in the workbook, but not with any manual control over order or timing:
ThisWorkbook.RefreshAll

Is there a particular reason they need to be spaced out?
With Application.Sheets("Pivot Tables")
.PivotTables("Pivot1").PivotCache.Refresh
.PivotTables("Pivot2").PivotCache.Refresh
.PivotTables("Pivot3").PivotCache.Refresh
End With

Open in new window

0
 
LVL 32

Expert Comment

by:Rob Henson
ID: 36816650
When the Pivot Tables were created, do they all use the same data source?

When creating a second pivot table using the same data source as a previous pivot table there should have been a message asking if you wanted to use the same data source. By saying No to this message it increases file size, hence why it is offered.

However, if the tables are linked to the same data source, refreshing one table will refresh all of them at the same time. I suspect this is the behaviour that you are seeing here that you want to get away from.

I suspect to get round this you would have to reset the data source for each pivot to be independent.

If this is on a large data source, I am guessing that this behaviour is causing the user's computer to slow/freeze while refreshing pivots whereas if they were done individually it may not cause this.

Thanks
Rob H
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

How to quickly and accurately populate Word documents with Excel data, charts and images (including Automated Bookmark generation) David Miller (dlmille) Synopsis In this article you’ll learn how to use ExcelToWord! to copy data,charts, shapes …
This article will guide you to convert a grid from a picture into Excel format using Microsoft OneNote and no other 3rd party application.
The viewer will learn how to simulate a series of sales calls dependent on a single skill level and learn how to simulate a series of sales calls dependent on two skill levels. Simulating Independent Sales Calls: Enter .75 into cell C2 – “skill leve…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

896 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now