J
Joe
Hi All.
I have a workbook with 6 sheets. Each sheet has a pivot table.
I have a button on another form that runs a query and populates yet another
sheet that each pivot table pulls from.
I want the pivot tables to refresh after the query is run.
I loop through all the sheets and then loop through all pivot tables and
call RefreshTable on each. I've also tried Refresh.
What happens is that first 2 sheets seems to refresh but the others don't.
Also, if there are no records when the pivot tables refresh they reduce down
to just the rows and column (which is normal) but when I refresh again and
there are records, the filter I put on the page field isn't retained - this
may be normal. If I reapply the filter I get a message that it cannot
overlap an existing pivot table. There are a few cells in the area that used
to be populated by a pivot table but no longer have any values there. I have
to delete the rows and then apply the filter.
I hope this makes sense.
I wonder if I'm better off creating the pivot tables each time. Are there
any examples of doing this in VBA?
Thanks,
Joe
I have a workbook with 6 sheets. Each sheet has a pivot table.
I have a button on another form that runs a query and populates yet another
sheet that each pivot table pulls from.
I want the pivot tables to refresh after the query is run.
I loop through all the sheets and then loop through all pivot tables and
call RefreshTable on each. I've also tried Refresh.
What happens is that first 2 sheets seems to refresh but the others don't.
Also, if there are no records when the pivot tables refresh they reduce down
to just the rows and column (which is normal) but when I refresh again and
there are records, the filter I put on the page field isn't retained - this
may be normal. If I reapply the filter I get a message that it cannot
overlap an existing pivot table. There are a few cells in the area that used
to be populated by a pivot table but no longer have any values there. I have
to delete the rows and then apply the filter.
I hope this makes sense.
I wonder if I'm better off creating the pivot tables each time. Are there
any examples of doing this in VBA?
Thanks,
Joe