Pivot Table

J

juanpablo

Hi,

I have like 8 pivot tables in a some sheet.
Is it possible to have just one update button to update all tables at a time?

Thanks

JPG
 
K

Kevin B

Press Alt+F11 to open the VBE and then click INSERT in the menu and select
MODULE.

Enter the following sub

Sub GlobalUpdate()

Dim pt As PivotTable
Dim ws As Worksheet

For Each ws In ThisWorkbook.Worksheets
For Each pt In ws.PivotTables
pt.Update
Next pt
Next ws

Set pt = Nothing
Set ws = Nothing

End Sub

Save the module, click FILE in the menu and select CLOSE AND RETURN TO EXCEL.

Then modify a toolbar and assign the macro named GlobalUpdate to a toolbar
button
 
J

juanpablo

Ok great, thanks.
When I execute the macro, insuficient memory :(
Any ideas how to improve?

Regards

JPG
 
K

Kevin B

I don't know how your pivot tables have been created, but if they're all
using the same pivot data you can conserve by using an existing pivot table
as the data source for the next pivot table you create. Any time you can
reference an existing pivot table as a data source you'll be conserving
resources.

The only other thing that I can think of is close all unnecessary
applications, or get additional RAM for your PC.
 

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

Top