Macro for Pivot Tables

G

Guest

Hi, I'm having trouble building a macro on pivot tables. I hope some experts
here can help solve my problem. Any inputs will be greatly appreciated!!

I'm trying to build a macro to refresh data in multiple pivot tables. The
pivot tables are build below one another, and additional rows are inserted
between pivot tables.

When i built a macro to link all tables to the data in the first (master)
pivot table, I found Excel was refreshing the table based on the exact cell I
was clicking. This has become a problem since new rows are inserted between
tables when new data comes in, and pivot tables are no longer at those cells.
The macro i've built cannot refer to the tables and crashed as a result.

I was wondering if I can define or use a dynamic name to select a pivot
table instead of selecting a cell. My colleagues does not know VB and are not
interested in using codes to solve this problem. I was wondering if this can
be done simply.

Hope someone can offer me help. Thanks in advance.
 
D

Debra Dalgleish

You can refresh all external data ranges and PivotTables in the active
workbook, with the following code:

ActiveWorkbook.RefreshAll
 

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