+ Reply to Thread
Results 1 to 4 of 4

Recorded Pivot Table Macro Doesn't Do What I Recorded!

  1. #1
    Registered User
    Join Date
    11-06-2009
    Location
    Arkansas
    MS-Off Ver
    Excel 2007
    Posts
    48

    Recorded Pivot Table Macro Doesn't Do What I Recorded!

    I'm just getting in to pivot tables, so in my attempt to control them with VBA I recorded my self making a pivot table to count the occurrences of an item. I based what I was trying to do off of this youtube video: http://www.youtube.com/watch?v=OlTsegp3cDY

    In short, I have a table like this:
    Items Months
    Bananas May
    Apples June
    Banans July
    Bananas August
    Apples September
    Oranges November

    It's on Sheet49, starting in R1C1. I recorded the following Macro while creating a PivotTable that includes the number of occurrences of each item. When I'm done, it looks like this:
    Pivot1.PNG

    However, when I delete the pivot table, and run the recorded Macro (see below):
    Please Login or Register  to view this content.
    All I get is this:
    Pivot2.PNG

    I loose all the data in the PivotTable and only get the total number of items!

    What is going on?

    Thanks for any help!

  2. #2
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: Recorded Pivot Table Macro Doesn't Do What I Recorded!

    change the order
    Please Login or Register  to view this content.
    Josie

    if at first you don't succeed try doing it the way your wife told you to

  3. #3
    Registered User
    Join Date
    11-06-2009
    Location
    Arkansas
    MS-Off Ver
    Excel 2007
    Posts
    48

    Re: Recorded Pivot Table Macro Doesn't Do What I Recorded!

    Unbelievable. You're a genius man. It's like you actually know what you are doing! That fixed it. Thanks a lot.

    ...still wondering why the order is wrong if I simply recorded the macro...

    Like your signature, BTW, JosephP.

  4. #4
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: Recorded Pivot Table Macro Doesn't Do What I Recorded!

    the macro recorder is a pretty old and ornery critter and its memory ain't as good as it used to be so sometimes it gets things wrong. especially in 2007 where it often forgets to record anything at all ;-)

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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