• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

VBA snippet to refresh pivotTables one by one

Hi,

Can anyone help me with a vba code snippet to refresh pivot table one by one. Presently I have this to refresh all.

ub RefreshAllPivotTables()

Dim PT As PivotTable
Dim WS As Worksheet

For Each WS In ThisWorkbook.Worksheets

For Each PT In WS.PivotTables
PT.RefreshTable
Next PT

Next WS

End Sub

At times, it throws up below error;

"Excel cannot complete this task with available resources. Choose less data or close other applications."
 
Hi Karthik,

Just a blind guess.

Did you tried..

ActiveWorkbook.RefreshAll

Caution: It will refresh all the Data connection also in the sheet.(if you have any.. :))
 
Hi @Debraj ,
I am facing the above mentioned problem when I try refreshing all at once. So i require pivotTable1.refresh next pivotTable2.refresh etc

Can you please help?

Thanks,
Karthik
 
Back
Top