+ Reply to Thread
Results 1 to 6 of 6

Change series colour for all charts on a worksheet.

  1. #1
    Registered User
    Join Date
    08-27-2013
    Location
    Manhattan, US
    MS-Off Ver
    Excel 2013
    Posts
    3

    Change series colour for all charts on a worksheet.

    Hello. This is my first post on this forum. ...I'll be much obliged by any help offered to this problem! I have a worksheet where I need to set all of the colours of my charts back to a default palette. I was exploring two options:

    Please Login or Register  to view this content.
    As some charts have fewer than 5 series, I thought it best to use something like the following:

    Please Login or Register  to view this content.
    However, both return errors of the type: "Object doesn't support this property or method", highlighting the first line after the "With" statement... though I suspect there may be errors beyond just that...

    I'm using Excel 2013. The series on the different charts are not named 1-5, but there are usually 5 of them.

    Again - many thanks.

  2. #2
    Valued Forum Contributor
    Join Date
    02-08-2012
    Location
    Newcastle, Australia
    MS-Off Ver
    Excel 2007 and Excel 2010
    Posts
    1,429

    Re: Change series colour for all charts on a worksheet.

    Hi,

    Try changing
    Please Login or Register  to view this content.
    to
    Please Login or Register  to view this content.
    You shouldn't need to reference "i" to return the count of SeriesCollection.

    If this doesn't help, can you please upload a workbook so that I may debug your code in context?

    Hope this helps

  3. #3
    Registered User
    Join Date
    08-27-2013
    Location
    Manhattan, US
    MS-Off Ver
    Excel 2013
    Posts
    3

    Re: Change series colour for all charts on a worksheet.

    Hi Ajryan88. Thank you for your reply. It has not resolved the issue for me - same error. Sadly I cannot upload the actual workbook as it is too large, but I have uploaded a workbook with the same sort of construction. Note that the function gets called on the "worksheet activate" event.

    http://temp-share.com/download/4593a...371ac96d0df518 (Ensure to click the grey {not green} 'Download' button.)

    (I have not used this filesharer before.)
    Last edited by DonaldDump; 08-28-2013 at 05:16 PM.

  4. #4
    Valued Forum Contributor
    Join Date
    02-08-2012
    Location
    Newcastle, Australia
    MS-Off Ver
    Excel 2007 and Excel 2010
    Posts
    1,429

    Re: Change series colour for all charts on a worksheet.

    Hi,

    Try this code:
    Please Login or Register  to view this content.
    The problem was that a "ChartObject" (oChart) doesn't have a "SeriesCollection" attached to it, but it does have a "Chart" element which does have a series collection. So as you can see, the adjustments are very minor, and you were very close.

    Hope this helps

  5. #5
    Registered User
    Join Date
    08-27-2013
    Location
    Manhattan, US
    MS-Off Ver
    Excel 2013
    Posts
    3

    Re: Change series colour for all charts on a worksheet.

    Excellent. This works perfectly - you guys do a great service on forums like these, thank you.

  6. #6
    Valued Forum Contributor
    Join Date
    02-08-2012
    Location
    Newcastle, Australia
    MS-Off Ver
    Excel 2007 and Excel 2010
    Posts
    1,429

    Re: Change series colour for all charts on a worksheet.

    You're welcome!

    Please don't forget to mark this thread as solved

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Macro with IF statement for if a series exists change colour of line in graph
    By sim410 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 11-21-2012, 06:20 AM
  2. Need help getting column charts to change colour based on values
    By NPC1977 in forum Excel Charting & Pivots
    Replies: 7
    Last Post: 10-08-2012, 07:44 PM
  3. Change colour of chart series
    By downunderthunder in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 01-06-2010, 09:20 PM
  4. Stacked Area Chart Series Colour Change
    By downunderthunder in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-06-2010, 09:18 PM
  5. [SOLVED] Change lots of series on a scatter graph to one colour
    By rmellison in forum Excel General
    Replies: 0
    Last Post: 02-03-2006, 07:35 AM

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