• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

changing bar chart color for individual data points based on name

WEGC7

New Member
Hi, I am new to the group and VBA. I am using Excel 2012. I have a chart based off a pivot table where the x-axis are values such as shape, surface, and Width(one series) The column chart is weight(primary y-axis) and the line graph (secondary y-axis) is % of total. I can change the colors of each column based on position using this.


ActiveChart.SeriesCollection(1).Select

ActiveChart.SeriesCollection(1).Points(1).Interior.Color = RGB(155, 187, 89)


However, i need to change the colors of each column based on the value name (i.e. Shape, width, Surface), not the position, as the positions change each week.


I've tried the following with no success as well as others.


nPoint = Activechart.seriescollection(1).Points.Count

For iPoint = 1 To nPoint

If Activechart.seriescollection(1).Points(iPoint) = "Shape" Then

Activechart.seriescollection(1).Points(iPoint).Interior.Color = RGB(255, 0, 0)

End If

Next iPoint


thanks in advance...
 
Back
Top