Results 1 to 3 of 3
  1. #1
    3 Star Lounger
    Join Date
    Jul 2002
    Location
    Ankeny, Iowa, USA
    Posts
    344
    Thanks
    8
    Thanked 0 Times in 0 Posts

    Refresh All Pivot Tables (Excel 2002)

    Hi!
    I am wanting to refresh all the pivot tables in my worksheet (there are about 16 in total). I recorded a macro when I pressed the refresh all button and got the following code "ActiveWorkbook.RefreshAll". I also have some msqueries in the workbook, but I do NOT wish to have these refreshed, so is there a different code that would refresh all my 16 pivot tables without refreshing the msquery?
    Thanks!! I'm sure glad the lounge is back!
    Lana

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Refresh All Pivot Tables (Excel 2002)

    Try this:

    Sub UpdatePivotTables()
    Dim pc As PivotCache
    For Each pc In ActiveWorkbook.PivotCaches
    pc.Refresh
    Next pc
    End Sub

  3. #3
    3 Star Lounger
    Join Date
    Jul 2002
    Location
    Ankeny, Iowa, USA
    Posts
    344
    Thanks
    8
    Thanked 0 Times in 0 Posts

    Re: Refresh All Pivot Tables (Excel 2002)

    Perfect!
    Thanks Hans!
    Lana

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •