+ Reply to Thread
Results 1 to 3 of 3

VBA for inserting pivot tables

Hybrid View

  1. #1
    Registered User
    Join Date
    01-13-2010
    Location
    Cadillac, MI
    MS-Off Ver
    Excel 2003
    Posts
    83

    VBA for inserting pivot tables

    I have successfully created a macro that highlights an entire data range inserts a pivot table. However, I am stumped on how to code the VBA when it comes to the following pivot table scenario.

    Within the pivot table, the beginning column is for part number, and the subsequent summary columns are based upon column heading that are dates. So the pivot table would show as:

    PartNumber Sum of Nov16 Sum of Nov 17 Sum of Nov 18 Sum of Nov 19

    But what should I do when my data range now contains new column headings beyond these dates - they now show Nov 20, Nov 21, Nov 22, Nov 23

  2. #2
    Forum Contributor IonutC's Avatar
    Join Date
    01-28-2016
    Location
    Bucharest, Romania
    MS-Off Ver
    Office 2019
    Posts
    486

    Re: VBA for inserting pivot tables

    Record a Macro and see what code the macro is showing to you, then customize the last part from the recorded macro in order to see which is the correct part in order to see the required parts,
    Please consider:
    Be polite. Thank those who have helped you.
    Click the star icon in the lower left part of the contributor's post and add Reputation. If you are satisfied with the help you have received, then Please do Mark your thread [SOLVED] .
    Click on GO ADVANCED and then scroll down to Manage Attachments to open the upload window.
    Posting code between tags makes your code much easier to read and copy for testing, it also maintains VBA formatting.

  3. #3
    Forum Contributor IonutC's Avatar
    Join Date
    01-28-2016
    Location
    Bucharest, Romania
    MS-Off Ver
    Office 2019
    Posts
    486

    Re: VBA for inserting pivot tables

    take a look here.

    http://peltiertech.com/referencing-p...ranges-in-vba/

+ 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. Creating a Master / Consolidated Pivot Tables from a multiple pivot tables
    By paradise2sr in forum Excel Charting & Pivots
    Replies: 4
    Last Post: 12-12-2013, 02:28 AM
  2. Creating a Master / Consolidated Pivot Tables from a multiple pivot tables
    By paradise2sr in forum Excel Charting & Pivots
    Replies: 0
    Last Post: 12-08-2013, 10:49 PM
  3. Pivot Tables - need to do separate pivot tables for multiple sheets in same format
    By tconnell1965 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 09-18-2013, 07:04 AM
  4. Validating Data Between 2 Pivot Tables (Pivot Tables Don't Line Up)
    By JohnGC84 in forum Excel Charting & Pivots
    Replies: 0
    Last Post: 06-18-2013, 05:07 PM
  5. Replies: 0
    Last Post: 09-22-2012, 07:22 PM
  6. Inserting new data into tables and pivot charts
    By andykent99 in forum Excel General
    Replies: 3
    Last Post: 05-24-2011, 12:01 PM
  7. Inserting calculated fields in Pivot Tables
    By mbhcfo in forum Excel General
    Replies: 1
    Last Post: 04-10-2007, 09:02 AM
  8. Pivot tables - inserting columns
    By Scott in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 03-18-2005, 10:06 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