Activate Worksheet Function and pivot tables

Posted on 2011-09-30
Last Modified: 2012-05-12
Private Sub Worksheet_Activate()
End Sub

Open in new window


I have a single pivot table in a worksheet. I've added the above to the worksheet (as an event on activation)

I just want to know, would a full refresh of the whole worksheet (like above), refresh the pivot table as well?

Or do I have to click on pivot table and then go to 'PivotTable Tools' ribbon and click 'Refresh all'?

Question by:Shanan212
  • 2
LVL 13

Accepted Solution

Shanan212 earned 0 total points
ID: 36892566

I figured I would put this function to capture all existing pivots and refresh them all

Private Sub Worksheet_Activate()

Dim piv As PivotTable

    For Each piv In ActiveSheet.PivotTables


    Next piv
End Sub

Open in new window

LVL 13

Author Closing Comment

ID: 36892571
This answers the question

Featured Post

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This Article is a follow-up to my Mappit! Addin Article (, it was inspired by an email posting I made to EUSPRIG (, I will briefly cover: 1) An overvie…
When you see single cell contains number and text, and you have to get any date out of it seems like cracking our heads.
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question