Pivot tables macro

  • Thread starter Thread starter Spreadsheet
  • Start date Start date
S

Spreadsheet

I have two issues with some pivot tables.

Firstly, I want to place a pivot table directly underneath another
Pivot table. The upper table has grouped items (double-clicking on the
group name causes the table to show the grouped items and expand).
However, this causes an error because there is a pivot table right
below the top table and the expansion of the the top table would cause
the two to overlap. Is it possible for the bottom pivot table to be
shifted down whenever the top table is expanded, and shifted back up
when the top table is minimizes?

Secondly, I want all of my pivot tables to be refreshed (Alt-D-R)
whenever I run a macro. The macro already exists and performs other
tasks. The refreshing of the pivot tables would just be an additional
task for the macro to perform.

Any help would be appreciated.
 
Firstly: No
Secondly: Here's what I use to refresh my pivot tables

Sub PTableUpdate()
Dim PT As PivotTable
Dim Sht As Worksheet
Application.StatusBar = "Updating Pivot Charts. Please wait."
Application.ScreenUpdating = False
For Each Sht In ActiveWorkbook.Worksheets
For Each PT In Sht.PivotTables
PT.RefreshTable
Next
Next
Application.ScreenUpdating = True
Application.StatusBar = False
End Sub

HTH

Die_Another_Day
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top