Solved

Update pivot table

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

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

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

A little background as to how I came to I design this code: Around 5 years ago I designed an add-in that formatted Excel files to a corporate standard, applying different cell colours and font type depending on whether the cells contained inputs,…
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.
This Micro Tutorial demonstrates how to create Excel charts: column, area, line, bar, and scatter charts. Formatting tips are provided as well.
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.

738 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