Solved

Update pivot table

Posted on 2014-11-21
2
123 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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Compile Error: Expected List Separator or) error message 5 31
EXCEL Addin problem 7 27
Macro 3 21
TT Auto DashBoard 4 33
Introduction This Article is a follow-up to my Mappit! Addin Article (http://www.experts-exchange.com/A_2613.html), it was inspired by an email posting I made to EUSPRIG (http://www.eusprig.org/index.htm), I will briefly cover: 1) An overvie…
This article descibes how to create a connection between Excel and SAP and how to move data from Excel to SAP or the other way around.
The viewer will learn how to use a discrete random variable to simulate the return on an investment over a period of years, create a Monte Carlo simulation using the discrete random variable, and create a graph to represent the possible returns over…
This Micro Tutorial will demonstrate how to create pivot charts out of a data set. I also added a drop-down menu which allows to choose from different categories in the data set and the chart will automatically update.

746 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now