+ Reply to Thread
Results 1 to 2 of 2

Help with pivot table macro

  1. #1
    Registered User
    Join Date
    12-27-2006
    Posts
    1

    Help with pivot table macro

    Hey guys, new member here. Im sorry if this has been asked before, but I cannot seem to find it in search.

    Is there a macro to Reset the pivot table? as in get rid of every field in the table? like 'ClearAllPivotTableDataDammit!'

    Why I need this is because I need to make some command buttons for my boss who is not too pivot table savy.
    So I want to put buttons like "per month" "per customer" "per item" on top of the table, so that when he clicks on it, the table rearranges itself.

    I have tried several macros myself. But the usual problem is, the button works if pressed from the default pivot state, but then after the pivot changes, or if something is removed the macro would err.
    So the only way I can think of doing this effectively is to wipe the table clean then rearrange the fields.
    I dont know, is there a better way of doing it?

    Thanks in advance.

  2. #2
    Forum Expert mrice's Avatar
    Join Date
    06-22-2004
    Location
    Surrey, England
    MS-Off Ver
    Excel 2013
    Posts
    4,967

    Response

    You could try using the record function to work though all of the possible combinations of transitions and then use the code in a macro which leaves a tag in an 'out of sight' cell which records the state the pivot table is cueently in.

    This way you could use select case statements to get the behaviour that you want.
    Martin

+ 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