+ Reply to Thread
Results 1 to 5 of 5

Column color based on series name?

  1. #1
    Registered User
    Join Date
    08-17-2009
    Location
    Ontario, Canada
    MS-Off Ver
    Excel 2007
    Posts
    3

    Column color based on series name?

    Hi,

    So far I haven't found an answer to this. I have to reformat about 25 charts and I want the columns to be colored based on the series name so that it is the same in all the charts. I found this one macro, and it worked initially when I tested it, but then it just stopped and I can't get it to work again!? Basically, you are supposed to just create a set of color coded index cells.

    Any help appreciated (or why this stupid macros might stop working).

    Please Login or Register  to view this content.
    Last edited by mlazenby; 08-18-2009 at 10:29 AM. Reason: code tags

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

    Re: Column color based on series name?

    Please add code tags to your post.

    Post workbook example where the code is not working.
    Cheers
    Andy
    www.andypope.info

  3. #3
    Registered User
    Join Date
    08-17-2009
    Location
    Ontario, Canada
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: Column color based on series name?

    Ok - after I fixed the code, the macros will run - until you save the sheet. When you reopen the sheet and try to run it gives the following error:

    With ActiveChart.SeriesCollection(1)

    Run Time Error 91
    Object variable or with block variable not set

    WTF?

    I attached the worksheet with the macro.
    Attached Files Attached Files
    Last edited by mlazenby; 08-18-2009 at 12:04 PM. Reason: Wrong - problem still exists

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

    Re: Column color based on series name?

    When you reopen the workbook a cell would be active rather than a chart.
    If you select the chart first then run the code does it work again?

    Try using code that does not require the chart to be selected
    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    08-17-2009
    Location
    Ontario, Canada
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: Column color based on series name?

    Jeez! And I could have sworn I checked that. Must have been at the same time I mixed up the two code snippets.

    Thanks.

+ 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