Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 448
  • Last Modified:

Activate Worksheet Function and pivot tables

Private Sub Worksheet_Activate()
	ActiveWorkbook.RefreshAll
End Sub

Open in new window


Hi,

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'?

Thanks!
0
Shanan212
Asked:
Shanan212
  • 2
1 Solution
 
Shanan212Author Commented:
Nevermind,

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

        piv.RefreshTable

    Next piv
End Sub

Open in new window

0
 
Shanan212Author Commented:
This answers the question
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now