+ Reply to Thread
Results 1 to 5 of 5

vba - formatting multiple pivot charts?

  1. #1
    Forum Contributor
    Join Date
    10-17-2008
    Location
    Vancouver
    MS-Off Ver
    2002 and XP
    Posts
    117

    vba - formatting multiple pivot charts?

    Hello All,

    So found out how to format pivot tables using a for each...in .... loop, but need to do the same for pivot charts, and one bit of code is off.

    Here is the successful code for pivot tables
    Please Login or Register  to view this content.
    and here is the unsuccessful code for the pivot charts
    Please Login or Register  to view this content.
    Code breaks on this line
    Please Login or Register  to view this content.
    With the phrase
    Object doesn't support this property or method
    sigh. so close.


    EDIT: see follow-up question below
    Last edited by kuraitori; 03-15-2010 at 05:00 PM.

  2. #2
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,437

    Re: vba - formatting multiple pivot charts?

    Avoid using variables names that are already being used as object names.

    a chartobject does not have multiple charts.

    Please Login or Register  to view this content.
    Cheers
    Andy
    www.andypope.info

  3. #3
    Forum Contributor
    Join Date
    10-17-2008
    Location
    Vancouver
    MS-Off Ver
    2002 and XP
    Posts
    117

    Re: vba - formatting multiple pivot charts?

    Works wonderfully, thank you so much

  4. #4
    Forum Contributor
    Join Date
    10-17-2008
    Location
    Vancouver
    MS-Off Ver
    2002 and XP
    Posts
    117

    Re: vba - formatting multiple pivot charts?

    Quick Question,

    How do I do the same with Datalabels?

    add datalabels, delete datalabels, and font size = 10 (for datalabels)

    There is a flexable number of series in the data collection.

  5. #5
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,437

    Re: vba - formatting multiple pivot charts?

    You can use the macro recorder to get most of the code.

    You will also need to use the SeriesCollection and Datalabels collections.

+ 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