+ Reply to Thread
Results 1 to 2 of 2

PivotTable VBA Error

  1. #1
    Registered User
    Join Date
    05-08-2019
    Location
    Detroit
    MS-Off Ver
    Windows 10
    Posts
    4

    PivotTable VBA Error

    I have a set of data that I replace each week. I have found that a pivot table I created last week will lose its links when I replace the data on sheet "Working Data". Is it possible to keep the range A:L in a Pivot Table, along with the format of what data is in rows and such?

    If the above isn't possible, I have moved onto creating a macro to recreate each PivotTable each week, the issue with this is I run into this error: "unable to get the pivot tables property of the worksheet class", I believe it is because the .PivotTables("PiviotTable14") is the issue?

    ActiveWorkbook.Worksheets("Summary").PivotTables("PivotTable14").PivotCache. _
    CreatePivotTable TableDestination:="PivotTable!R2C1", TableName:= _
    "PivotTable16", DefaultVersion:=6

    Any insight would be appreciated...

  2. #2
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    7,920

    Re: PivotTable VBA Error

    Consider building your Pivot Table from an Excel Table. http://www.utteraccess.com/wiki/Tables_in_Excel.

    Excel tables know how big they are, so if you remove the old data and copy / paste in the new data and refresh the pivot table, you should be good.
    One spreadsheet to rule them all. One spreadsheet to find them. One spreadsheet to bring them all and at corporate, bind them.

    A picture is worth a thousand words, but a sample spreadsheet is more likely to be worked on.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Error 400 when modifying pivottable
    By stevj00 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-23-2018, 05:21 AM
  2. Trap PivotTable Error
    By swong1709 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-05-2014, 12:41 PM
  3. Error with PivotTable?
    By ItsTehShadow in forum Excel Charting & Pivots
    Replies: 0
    Last Post: 07-10-2013, 06:18 AM
  4. Error w/ Macro for PivotTable
    By kbspence in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-28-2012, 10:37 AM
  5. [SOLVED] Error ExportPicture in PivotTable
    By [email protected] in forum Excel General
    Replies: 0
    Last Post: 02-01-2006, 10:10 PM
  6. [SOLVED] PivotTable Calculated Item error
    By [email protected] in forum Excel General
    Replies: 1
    Last Post: 09-28-2005, 05:05 AM
  7. [SOLVED] Pivottable Error
    By mmwheeler in forum Excel General
    Replies: 0
    Last Post: 07-28-2005, 09:05 AM

Tags for this Thread

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