+ Reply to Thread
Results 1 to 4 of 4

Macro to auto create Pivot table

  1. #1
    Forum Contributor
    Join Date
    01-28-2014
    Location
    Manchester, UK
    MS-Off Ver
    Microsoft Office 365
    Posts
    127

    Exclamation Macro to auto create Pivot table

    I currently have 3 columns eg: Column1, Column2 and Column3

    Im trying to get a Macro to auto pivot this information

    Column1 would be the left hand side info
    Coulmn2 would be along the top
    Column3 would be the data in the body of the table

    However when i try to execute this i get the error below and not all columns are shown

    "Unable to get the PivotFields property of the PivotTable Class"

    If anyone could help me to achieve this perfectly that would be a great help

    My current code consists of

    Please Login or Register  to view this content.

  2. #2
    Valued Forum Contributor adyteo's Avatar
    Join Date
    01-10-2013
    Location
    Calgary
    MS-Off Ver
    Excel 2010
    Posts
    540

    Re: Macro to auto create Pivot table

    which line is highlighted when the error occurs?

    how was this code created:record macro or manually?
    Click on the star if you think I helped you

  3. #3
    Forum Contributor
    Join Date
    01-28-2014
    Location
    Manchester, UK
    MS-Off Ver
    Microsoft Office 365
    Posts
    127

    Re: Macro to auto create Pivot table

    Quote Originally Posted by adyteo View Post
    which line is highlighted when the error occurs?

    how was this code created:record macro or manually?
    Hello there

    This line is > With ActiveSheet.PivotTables("PivotTable2").PivotFields("SKU")

    For some reason when it gets to the pivot chart sheet the first 2 headers are missing which are what is in Columns A and B

    This code was created through recording a macro

    Thanks Dave

  4. #4
    Forum Contributor
    Join Date
    01-28-2014
    Location
    Manchester, UK
    MS-Off Ver
    Microsoft Office 365
    Posts
    127

    Re: Macro to auto create Pivot table

    Is anyone able to assist with this please ?

    Thanks

    Dave

+ 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. Macro to create pivot table/pivot chart
    By Karina in forum Excel General
    Replies: 2
    Last Post: 10-27-2011, 10:33 PM
  2. Excel 2007 : Macro to create pivot table
    By sloart in forum Excel General
    Replies: 1
    Last Post: 01-03-2011, 08:57 AM
  3. Create a pivot table in a macro
    By Excelliarmus in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-04-2008, 12:17 PM
  4. How do you create your own auto format for a pivot table
    By Marlyn in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 05-11-2006, 08:40 AM
  5. [SOLVED] macro to create a pivot table
    By Catie79 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-22-2005, 06:10 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