+ Reply to Thread
Results 1 to 5 of 5

VBA code to change pivot chart line on 12 charts

  1. #1
    Registered User
    Join Date
    10-18-2007
    MS-Off Ver
    2010
    Posts
    90

    VBA code to change pivot chart line on 12 charts

    Good morning,
    I have a workbook with 12 pivot charts on 2 sheets. I need to change the lines to all the same type, just different colors. Is there a way I can code this? I currently have the below, but I don't think it would be very efficient to code this for each of the 12 charts. Also note, some of the charts will have only 3 Series while others will have up to 8.

    Please Login or Register  to view this content.
    Thank you for your assistance!
    N

  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 code to change pivot chart line on 12 charts

    This should do all charts on the active sheet

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

  3. #3
    Registered User
    Join Date
    10-18-2007
    MS-Off Ver
    2010
    Posts
    90

    Re: VBA code to change pivot chart line on 12 charts

    Hey, Andy, thanks so much! That was amazingly simple (at least for me to copy and paste)!

    Now the recipient of this report has taken his question one step further. Each of the series represents a retailer and as stated previously each retailer may or may not be in the resulting pivot chart. On each chart he would like there to be consistency among each of the retailer colors, that is, to see Retailer A always in yellow, Retailer B always in blue, Retailer C always in green, etc. If Retailer A is not represented on a given chart then another retailer should not be yellow. Does that make sense and is this possible to program?

    Thanks again!
    N

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

    Re: VBA code to change pivot chart line on 12 charts

    Something along these lines should do it.
    http://peltiertech.com/WordPress/vba...ategory-label/

  5. #5
    Registered User
    Join Date
    10-18-2007
    MS-Off Ver
    2010
    Posts
    90

    Thumbs up Re: VBA code to change pivot chart line on 12 charts

    Thanks, Andy, that site did it for me!

    Final code:
    Please Login or Register  to view this content.
    Thank you so much for your help!!
    N

+ 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