Pivot Tables Not Refreshing

Mudbutt

Board Regular
Joined
Jul 18, 2011
Messages
158
I'm running this code, yet there are a couple of pivot tables on my workbook that don't seem to be refreshing when i run it. I have 10+ pivot tables in the workbook, but when i check them by refreshing each one individually, there are a couple on one of the worksheets that change...meaning it wasn't refreshed by this code. What would the reasoning be? There are no restrictions whatsoever on the workbook or worksheets:

Code:
Dim ws As Worksheet
    Dim pt As PivotTable
For Each ws In Activeworkbook.Worksheets
        For Each pt In ws.PivotTables
            pt.RefreshTable
        Next pt
    Next ws
 

Excel Facts

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.
You did not say which version of Excel is being used.
Code:
' does using:
        pt.PivotCache.Refresh
' instead of:
        pt.RefreshTable
' make any difference?
 
Upvote 0

Forum statistics

Threads
1,224,517
Messages
6,179,233
Members
452,898
Latest member
Capolavoro009

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top