Quantcast
Channel: Refreshing all the pivot tables in my excel workbook with a macro - Stack Overflow
Viewing all articles
Browse latest Browse all 11

Answer by LohanJ for Refreshing all the pivot tables in my excel workbook with a macro

$
0
0

You have a PivotTables collection on a the VB Worksheet object. So, a quick loop like this will work:

Sub RefreshPivotTables()    Dim pivotTable As PivotTable    For Each pivotTable In ActiveSheet.PivotTables        pivotTable.RefreshTable    NextEnd Sub

Notes from the trenches:

  1. Remember to unprotect any protected sheets before updating the PivotTable.
  2. Save often.
  3. I'll think of more and update in due course... :)

Good luck!


Viewing all articles
Browse latest Browse all 11

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>