?
Solved

Pivot table question

Posted on 2011-09-28
2
Medium Priority
?
192 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 12

Accepted Solution

by:
telyni19 earned 2000 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 33

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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

When you see single cell contains number and text, and you have to get any date out of it seems like cracking our heads.
After seeing numerous questions for Dynamic Data Validation I notice that most have used Visual Basic to solve the problem. This suggestion is purely formula based and can be used in multiple rows.
This Micro Tutorial will demonstrate the scrolling table in Microsoft Excel using the INDEX function.
This Micro Tutorial will demonstrate how to create pivot charts out of a data set. I also added a drop-down menu which allows to choose from different categories in the data set and the chart will automatically update.

752 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