refresh pivot tables through a macro

D

dolph

Hi all,

I'm trying to create a macro to update pivot tables with a macro. but
when I create it and then try to run it, I receive the message: It'
impossible to find the propriety Pivot tables for the class Worksheet.
the Macro is:
"Sheets("Inserimento Dati").select
Range("H24").Select
ActiveSheet.PivotTables("tabella_pivot1").RefreshTable"

The system is Excel 2003 in XP. I did a similar macro in WIN 98 and it
worked, but it used a PivotTables wizard that does not work any more
in XP.

Thanks a lot in advance, hope I've been clear enough.
 
D

Dave Peterson

Where do you have your code?

maybe:
Sheets("Inserimento Dati").PivotTables("tabella_pivot1").RefreshTable

or if you think the name of the PT changed:

Dim PT As PivotTable
For Each PT In Worksheets("Inserimento Dati")
PT.RefreshTable
Next PT
 

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