Solved

Excel VBA approach to color a segment in a line chart

Posted on 2011-03-19
4
647 Views
Last Modified: 2012-05-11
I know how to color the whole line, and I have a routine that enumerates the points.  What is the property I can update to change a single segment at a certain point in a line chart?

Dave
0
Comment
Question by:dlmille
  • 3
4 Comments
 
LVL 50

Accepted Solution

by:
Ingeborg Hawighorst earned 500 total points
ID: 35173397
Hello,

which version of Excel?

In 2010 you can use something along these lines (formats the 3rd data point of the first series, change to suit)

    With ActiveChart.SeriesCollection(1).Points(3).Format.Line
        .Visible = msoTrue
        .ForeColor.ObjectThemeColor = msoThemeColorAccent3
        .ForeColor.TintAndShade = 0
        .ForeColor.Brightness = 0
        .Transparency = 0
    End With

Open in new window


cheers, teylyn
0
 
LVL 41

Author Comment

by:dlmille
ID: 35173552
Version 2007.

Thanks for pointing me to what I should have found in the object.

I'm not sure themecolor is correct as when I test this its zero for a chart where I've manually colored the segments.

SchemeColor, however has values.  I'm trying to relate a set of cells that are colored with the chart line segments.  What's the relationship with
a range.interior.color or .colorindex with schemecolor (or other related color property I should be using)?

Thanks,

Dave
0
 
LVL 41

Assisted Solution

by:dlmille
dlmille earned 0 total points
ID: 35173562
Got it - I just remembered + 7 on schemecolor will match a range.interior.colorindex color.

Thanks!

Dave
0
 
LVL 41

Author Closing Comment

by:dlmille
ID: 35205138
Accurate enough for me to get to the correct property I needed...
0

Featured Post

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Convert between Excel file formats (.XLS, .XLSX, .XLSM) with/without macro option David Miller (dlmille) Intro Over this past Fall, I've had the opportunity to see several similar requests and have developed a couple related solutions associate…
Excel can be a tricky bit of software to get your head around. Whilst you’ll be able to eventually get to grips with the basic understanding of how to get by, there are a few Excel tips that not everybody will even know about let alone know how to d…
This Micro Tutorial will demonstrate the scrolling table in Microsoft Excel using the INDEX function.
This Micro Tutorial demonstrates in Microsoft Excel how to consolidate your marketing data by creating an interactive charts using form controls. This creates cool drop-downs for viewers of your chart to choose from.

803 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question