?
Solved

Update pivot table

Posted on 2014-11-21
2
Medium Priority
?
134 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 93

Accepted Solution

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

Author Closing Comment

by:Frank Freese
ID: 40457957
Thanks Patrick
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

This tutorial explains how to create a series of drop-down lists that are dependent upon prior selections to guide (“force”) the user to make the correct selection and reduce data errors within Microsoft Excel. Excel 2010 was used for this tutorial;…
You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
This Micro Tutorial demonstrate the bugs in Microsoft Excel for Mac with Pivot Charts.
This Micro Tutorial will demonstrate in Google Sheets how to use the HYPERLINK function to create live links inside your spreadsheet.

752 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