Pivot Table Updating

T

Todd Huttenstine

Hey guys

I am using the above code(Chip Pearsons site) to update my pivot tables.
How would I get it to look at all the sheets in the workbook and update the
pivot tables if there are any?

Dim iP As Integer
For iP = 1 To ActiveSheet.PivotTables.Count
ActiveSheet.PivotTables(iP).RefreshTable
Next

Thanx

Todd Huttenstine
 
F

Frank Kabel

Hi
try
sub refresh_all_pivot()
Dim ws As Worksheet
Dim pt As PivotTable

On Error Resume Next
For Each ws In ActiveWorkbook.Worksheets
For Each pt In ws.PivotTables
pt.RefreshTable
Next
Next
end sub
 

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