Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Stopping pivot table refresh


I currently have a file built that allows users to see
some calculations based upon what months they select from
a form. They can select up to 48 months (past 4 years of
data). Data is stored in 3 pivot tables and users see a
report produced from this data. Once users select a
number of months, they click on a button and the VBA
starts. The code loops through each one of the 48 months
to see if it has been selected, if it has, it
is 'visible' in the pivot table. The code loops through
all 48 months for the 3 pivot tables.

This is what I need help with. Once the button is clicked
and the code starts to run, it can take up to 25 minutes
to finish since the pivot table is refreshed each time a
month is hidden or unhidden. I've turned off the
automatic calculation, but that does not stop the pivot
table refreshing.

Any thoughts on how to stop the pivot tables from
refreshing until all of the months have looped through?

Thanks,

-Scott
---

Sheets("Pivot").Select
With ActiveSheet.PivotTables("PivotTable1").PivotFields
("Fiscal Month")
For x = 0 To (MonthListSize - 1)
.PivotItems(MonthList(x, 0)).Visible = MonthList
(x, 1)
Next x
End With

Sheets("Pivot - Geo").Select
With ActiveSheet.PivotTables("PivotTable1").PivotFields
("Fiscal Month")
For x = 0 To (MonthListSize - 1)
.PivotItems(MonthList(x, 0)).Visible = MonthList
(x, 1)
Next x
End With

Sheets("Pivot - Industry").Select
With ActiveSheet.PivotTables("PivotTable1").PivotFields
("Fiscal Month")
For x = 0 To (MonthListSize - 1)
.PivotItems(MonthList(x, 0)).Visible = MonthList
(x, 1)
Next x
End With

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Stopping pivot table refresh

Scott, if you try this at the beginning of your code it
may help

Application.ScreenUpdating = False

This stops the screen trying to continually refresh and
can produce some siginificant performance gains

-----Original Message-----

I currently have a file built that allows users to see
some calculations based upon what months they select from
a form. They can select up to 48 months (past 4 years of
data). Data is stored in 3 pivot tables and users see a
report produced from this data. Once users select a
number of months, they click on a button and the VBA
starts. The code loops through each one of the 48 months
to see if it has been selected, if it has, it
is 'visible' in the pivot table. The code loops through
all 48 months for the 3 pivot tables.

This is what I need help with. Once the button is clicked
and the code starts to run, it can take up to 25 minutes
to finish since the pivot table is refreshed each time a
month is hidden or unhidden. I've turned off the
automatic calculation, but that does not stop the pivot
table refreshing.

Any thoughts on how to stop the pivot tables from
refreshing until all of the months have looped through?

Thanks,

-Scott
---

Sheets("Pivot").Select
With ActiveSheet.PivotTables("PivotTable1").PivotFields
("Fiscal Month")
For x = 0 To (MonthListSize - 1)
.PivotItems(MonthList(x, 0)).Visible = MonthList
(x, 1)
Next x
End With

Sheets("Pivot - Geo").Select
With ActiveSheet.PivotTables("PivotTable1").PivotFields
("Fiscal Month")
For x = 0 To (MonthListSize - 1)
.PivotItems(MonthList(x, 0)).Visible = MonthList
(x, 1)
Next x
End With

Sheets("Pivot - Industry").Select
With ActiveSheet.PivotTables("PivotTable1").PivotFields
("Fiscal Month")
For x = 0 To (MonthListSize - 1)
.PivotItems(MonthList(x, 0)).Visible = MonthList
(x, 1)
Next x
End With

.

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
slow document / pivot table refresh and pivot function Justin Larson[_2_] Excel Discussion (Misc queries) 1 April 2nd 09 06:41 PM
Stopping a pivot table from reformatting column sizes and widths Schwimms Excel Discussion (Misc queries) 1 November 12th 07 11:19 PM
Create refresh button in worksheet to refresh Pivot Table Data Ron Excel Worksheet Functions 1 October 13th 07 01:20 AM
refresh a new worsheet on pivot table refresh [email protected] Excel Worksheet Functions 0 February 9th 07 07:39 PM
Pivot Table refresh neeses Excel Discussion (Misc queries) 7 January 31st 06 01:35 PM


All times are GMT +1. The time now is 07:25 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"