+ Reply to Thread
Results 1 to 2 of 2

macro to expand and collapse a pivot field failing.

  1. #1
    Forum Contributor
    Join Date
    02-16-2008
    Location
    Mansfield, TX
    Posts
    324

    macro to expand and collapse a pivot field failing.

    Hello, I thought I would try to write a macro to expand and collapse a pivot field. I recorded both expanding and collapsing the pivot field in the macro recorder and tried to combine the two with an if statement but it is failing on the first line of the macro with a "Run time erro 1004: application defined or object defined erro" message. Can someone tell me why as I have no idea.

    Please Login or Register  to view this content.

  2. #2
    Valued Forum Contributor
    Join Date
    08-23-2009
    Location
    Hampshire, UK
    MS-Off Ver
    Excel 2003, Excel 2007
    Posts
    328

    Re: macro to expand and collapse a pivot field failing.

    I'm not sure exactly what you are trying to expand/contract. Have you grouped some items? The ShowDetail = true/false works for pivot items but I don't think it works for whole fields.

    If you want to toggle showing/hiding the Year field you could use something like
    Please Login or Register  to view this content.
    If this isn't what you need, perhaps you could upload an example file.

+ 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