+ Reply to Thread
Results 1 to 6 of 6

Macro to create Pivot table with details hidden(Grouped) at first.

  1. #1
    Registered User
    Join Date
    08-30-2010
    Location
    london
    MS-Off Ver
    Excel 2003
    Posts
    30

    Macro to create Pivot table with details hidden(Grouped) at first.

    I have a simple Pivot table which I created with code (A mock up attached)
    I need the Pivot table to be created, showing the years as in the example, but with the Detail Rows ("Months") Hidden, until the user double clicks on one of the years so that the underlying hidden rows will show.

    Thanks in advance

    Ronan

    Please Login or Register  to view this content.
    Attached Files Attached Files

  2. #2
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,167

    Re: Macro to create Pivot table with details hidden(Grouped) at first.

    Hi Ronanm,
    I think you are looking for this line of code:
    Please Login or Register  to view this content.
    hope that helps
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  3. #3
    Registered User
    Join Date
    08-30-2010
    Location
    london
    MS-Off Ver
    Excel 2003
    Posts
    30

    Thumbs up Re: Macro to create Pivot table with details hidden(Grouped) at first.

    Cheers Marvin. Perfect, thanks...Ronan

  4. #4
    Registered User
    Join Date
    08-30-2010
    Location
    london
    MS-Off Ver
    Excel 2003
    Posts
    30

    Re: Macro to create Pivot table with details hidden(Grouped) at first.

    Mmmmnn

    However when I use real data I get problems... Code below. I'm guessing this is because I have a couple of levels...

    Please Login or Register  to view this content.
    Thanks

    Ronan

  5. #5
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,167

    Re: Macro to create Pivot table with details hidden(Grouped) at first.

    Hi Ronan,

    Without your workbook, it is a little hard to follow your code. That said here is what to look for.
    When you create the pivot table by hand, some options become available OR NOT. If you don't have a second level of rows then Exapand and Collapse don't make sense and won't function. If you have a Blank or non-date in a column of dates that you are trying to group on - you won't see the ability to group by dates. Pivot Tables are kind of smart (I hate accuse a program of being smart) in that it allows or disallows features based on the data or the arrangement of the data.

    With all the above. Create your pivot table and see what is available. You are most likely trying to perform a pivot function, in code, that isn't available.

    I hope the above helps, but can't be sure without your workbook, code and explaination of what you are trying to accomplish.

  6. #6
    Registered User
    Join Date
    08-30-2010
    Location
    london
    MS-Off Ver
    Excel 2003
    Posts
    30

    Re: Macro to create Pivot table with details hidden(Grouped) at first.

    Hi

    Thanks for the reply.

    I have attached a screenshot of the Pivot that is created(rather than anonomising the data), and an arrow which points to the Field that hides details when clicked on, plus another arrow which point to another which has already been clicked on.

    Really the wish is to have all the fields hidden when the Pivot has been created. Which I think should be OK, as it's not grouping, just hiding...

    Thanks

    Ronan
    Attached Images Attached Images
    Last edited by ronanm; 01-30-2011 at 07:30 AM. Reason: Forgot image attachment

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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