which pivot table is not refreshing

needexcelhelpnow

New Member
Joined
Aug 1, 2018
Messages
2
I have an excel workbook with lots and lots of sheets. Each sheet feeds into at least two pivot tables, so I have 100 + pivot tables in the workbook.

When I hit "refresh all" to update all the pivot tables, I’ve getting an error message “One or more field names used in the report are no longer valid. If you’re changing the name of a field in your data source, please type a new name in the field. One or more connections didn't refresh or the refresh operation was cancelled. would you like to refresh the remaining connections? ” . I want to know which particular pivot table is this error for?

Any thoughts?

Thank you much!
 

Excel Facts

Return population for a City
If you have a list of cities in A2:A100, use Data, Geography. Then =A2.Population and copy down.
Try running this code. Might need to do it more than once:

Code:
Sub pivot()

On Error GoTo errhandler

For Each sh In ThisWorkbook.Worksheets
    For Each pt In sh.PivotTables
        pt.PivotCache.Refresh
    Next
Next

Exit Sub

errhandler:

MsgBox sh.Name & ", " & pt.Name

End Sub
 
Upvote 0
You my friend are amazing! Thank you.


Try running this code. Might need to do it more than once:

Code:
Sub pivot()

On Error GoTo errhandler

For Each sh In ThisWorkbook.Worksheets
    For Each pt In sh.PivotTables
        pt.PivotCache.Refresh
    Next
Next

Exit Sub

errhandler:

MsgBox sh.Name & ", " & pt.Name

End Sub
 
Upvote 0

Forum statistics

Threads
1,215,808
Messages
6,127,008
Members
449,351
Latest member
Sylvine

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