Solved

Update pivot table

Posted on 2014-11-21
2
128 Views
Last Modified: 2014-11-21
Folks,
I am looking for a solution on updating a pivot table when new data is entered into the source table or database. I know the code below will work. I would prefer not to leave the worksheet to return to update. Any suggestions on the code and the event it needs to be place would be appreciated.


Private Sub Worksheet_Deactivate()
       
   Dim pt As PivotTable
       
   Dim ws As Worksheet
      
    For Each ws In ActiveWorkbook.Worksheets
             
          For Each pt In ws.PivotTables
                             
      pt.RefreshTable
                   
    Next pt
        
  Next ws

End Sub

Open in new window

0
Comment
Question by:Frank Freese
2 Comments
 
LVL 92

Accepted Solution

by:
Patrick Matthews earned 500 total points
ID: 40457848
0
 

Author Closing Comment

by:Frank Freese
ID: 40457957
Thanks Patrick
0

Featured Post

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

Workbook link problems after copying tabs to a new workbook? David Miller (dlmille) Intro Have you either copied sheets to a new workbook, and after having saved and opened that workbook, you find that there are links back to the original sou…
This article will guide you to convert a grid from a picture into Excel format using Microsoft OneNote and no other 3rd party application.
The viewer will learn how to create two correlated normally distributed random variables in Excel, use a normal distribution to simulate the return on different levels of investment in each of the two funds over a period of ten years, and, create a …
This Micro Tutorial will demonstrate how to use a scrolling table in Microsoft Excel using the INDEX function.

785 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