+ Reply to Thread
Results 1 to 2 of 2

Macro for automatically rewriting pivot part of the table

  1. #1
    Registered User
    Join Date
    12-09-2016
    Location
    london
    MS-Off Ver
    2013
    Posts
    12

    Macro for automatically rewriting pivot part of the table

    Hello,

    I have an excel report where I import data from database using SQL query and because of performance issues I have (Or at least I did not came up with anything better) to do it using pivot tables. But when I refresh query and there is new month involve, links connected to pivot does not work anymore.

    So I need to write a macro which will each month rewrite part of the pivot table where dates are. To be clear, I need a macro where I can specify 13 columns for 13 months in several pivot tables.

    Could anyone help me solve this please???

    Thanks,

    John.

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

    Re: Macro for automatically rewriting pivot part of the table

    Give me a little more information on what you mean by "links to pivot table does not work anymore." Could it be that you are using something like a cross-tab query and creating new headers that are not known to the pivot table?

    If so, then you should change the output of the query to produce the data in a normalized format.

    I use both databases and Excel and some things are done better in one than another. You could use VLOOKUP to do things that JOIN does in a database, but the database is usually much more efficient. On the other hand, you can do cross tab queries or use a pivot table in excel on normalized data. In this case, Excel wins.
    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. [SOLVED] Pivot Table Summary -- Part #'s do not show in Pivot but data is in worksheet
    By maryren in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 09-19-2013, 10:51 AM
  2. [SOLVED] Macro that automatically updates pivot table when data in separate worksheet is updated
    By Femi in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-09-2013, 08:48 AM
  3. Replies: 1
    Last Post: 03-28-2013, 11:31 AM
  4. Replies: 3
    Last Post: 03-07-2011, 03:18 AM
  5. Automatically Apply Macro's/Formula's and Pivot Table attributes
    By karobonas in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-14-2011, 05:50 AM
  6. Macro that will automatically add part number from table
    By jamie.c in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-18-2009, 11:48 AM
  7. Automatically Delete Pivot Table with Macro?
    By nbaj2k in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-19-2006, 04:25 PM
  8. Rewriting the code in Pivot table - owc11 version
    By haikramesh in forum Excel Charting & Pivots
    Replies: 0
    Last Post: 04-04-2005, 12:42 PM

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