+ Reply to Thread
Results 1 to 5 of 5

Create a macro to create a pivot table in a worksheet

  1. #1
    Forum Contributor
    Join Date
    10-03-2012
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    134

    Create a macro to create a pivot table in a worksheet

    I am trying to create a macro that creates a pivot table based on another worksheet. It will create that worksheet and rename that worksheet, but it doesn't create a pivot table. I used the following code, which I got from recording a macro and doing the exact thing I wanted it to do and this is the code that I got. I also noticed that is you remove your data and try to create a new pivot table it always changes the # (ie. Pivot table1, Pivot table2). Could this be messing it up? TIA!
    Sub MacroTest()
    '
    Please Login or Register  to view this content.
    Last edited by Triscia; 05-14-2015 at 12:05 PM.

  2. #2
    Valued Forum Contributor fredlo2010's Avatar
    Join Date
    07-04-2012
    Location
    Miami, United States
    MS-Off Ver
    Excel 365
    Posts
    762

    Re: Create a macro to create a pivot table in a worksheet

    Can you add code tags to your post.

    Thanks

  3. #3
    Forum Contributor
    Join Date
    10-03-2012
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    134

    Re: Create a macro to create a pivot table in a worksheet

    Can you refresh my memory on a code tag? Thanks!

  4. #4
    Forum Contributor
    Join Date
    10-03-2012
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    134

    Re: Create a macro to create a pivot table in a worksheet

    I think that I just edited my post and put the code tag around it. I think.

  5. #5
    Valued Forum Contributor fredlo2010's Avatar
    Join Date
    07-04-2012
    Location
    Miami, United States
    MS-Off Ver
    Excel 365
    Posts
    762

    Re: Create a macro to create a pivot table in a worksheet

    Hi,

    Try this code

    Please Login or Register  to view this content.
    Thanks

+ 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] Add a new worksheet then create a pivot table
    By pdalal in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-13-2015, 02:43 PM
  2. Replies: 1
    Last Post: 12-01-2014, 09:30 PM
  3. Macro to create Pivot table
    By rakeshgupt8 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-03-2014, 06:26 AM
  4. [SOLVED] Create New Worksheet/Pivot Table for Each Change in Criteria
    By philwilliams80 in forum Excel Programming / VBA / Macros
    Replies: 22
    Last Post: 08-15-2013, 11:05 AM
  5. macro to create pivot table(s) and sort out data in other worksheet
    By Astrid in forum Excel Programming / VBA / Macros
    Replies: 19
    Last Post: 12-22-2010, 05:55 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