Results 1 to 17 of 17

Refresh pivot table automatically when source data changes

Threaded View

carlito2002wgn Refresh pivot table... 03-31-2020, 12:54 PM
Eastw00d Re: Refresh pivot table... 03-31-2020, 02:17 PM
carlito2002wgn Re: Refresh pivot table... 03-31-2020, 04:27 PM
carlito2002wgn Re: Refresh pivot table... 03-31-2020, 04:57 PM
dorabajji Re: Refresh pivot table... 03-31-2020, 05:38 PM
carlito2002wgn Re: Refresh pivot table... 03-31-2020, 05:43 PM
MarvinP Re: Refresh pivot table... 03-31-2020, 05:51 PM
carlito2002wgn Re: Refresh pivot table... 03-31-2020, 07:47 PM
MarvinP Re: Refresh pivot table... 03-31-2020, 08:16 PM
carlito2002wgn Re: Refresh pivot table... 03-31-2020, 08:24 PM
Eastw00d Re: Refresh pivot table... 04-01-2020, 01:02 AM
carlito2002wgn Re: Refresh pivot table... 04-01-2020, 09:02 AM
CK76 Re: Refresh pivot table... 04-01-2020, 09:31 AM
carlito2002wgn Re: Refresh pivot table... 04-01-2020, 12:56 PM
Eastw00d Re: Refresh pivot table... 04-01-2020, 10:22 AM
carlito2002wgn Re: Refresh pivot table... 04-01-2020, 01:01 PM
CK76 Re: Refresh pivot table... 04-01-2020, 01:06 PM
  1. #1
    Forum Contributor
    Join Date
    10-03-2015
    Location
    North Carolina, USA
    MS-Off Ver
    Office 365
    Posts
    167

    Refresh pivot table automatically when source data changes

    Example file now attached!

    I have a workbook with several sheets including one named "Pivot" and one named "Timesheet". The sheet named Timesheet contains the source data for the pivot on the Pivot sheet.

    I have a dropdown on the Pivot sheet which changes the data in the Timesheet depending on the selection made. I want the pivot table to refresh automatically when I make my selections in the dropdown list.

    I am using the following code:

    Option Explicit
    
    Private Sub Worksheet_Change(ByVal Target As Range)
      Worksheets("Timesheet").PivotTables("Timesheet_Pivot").PivotCache.Refresh
    End Sub
    But it isn't working. When I make selections in the dropdown list, nothing updates in the pivot. If I go into the Timesheet source data and manually change some data, I get the following message:
    Run-time error '1004':
    Unable to get the PivotTables property of the Worksheet class

    How can I fix this problem? I named the table of data on the Timesheet sheet "Timesheet", and I named the Pivot table "Timesheet_Pivot".
    Attached Files Attached Files
    Last edited by carlito2002wgn; 03-31-2020 at 05:04 PM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Refresh Pivot Table Automatically when Source Data Changes
    By SirMaceOne in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-20-2019, 02:32 AM
  2. [SOLVED] Refresh data source (excel table) in power pivot
    By maboho93 in forum Excel Charting & Pivots
    Replies: 11
    Last Post: 06-08-2018, 04:13 AM
  3. Automatically refresh source data in Power Pivot Window
    By rv02 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 09-15-2015, 11:49 AM
  4. Can't Refresh Pivot Table When Using External Data Source
    By yenping.fu in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 05-02-2014, 06:24 AM
  5. Replies: 0
    Last Post: 08-14-2013, 06:31 AM
  6. Macro to refresh pivot table and update data source
    By TBO in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-01-2013, 01:09 PM
  7. [SOLVED] Auto Refresh Pivot Table Once External Data source Changes
    By djfatboyfats in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-11-2012, 10:33 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1