I want to highlight some series in my stack chart - this is I have implemented. But the chart is dynamic, so when I change selection I need to highlight other series. But what was highlighted previously remains highlighted.
I am thinking to tun a cycle through all series and assign Fill Color of the series as "Automatic" each time when I change the source. Then I could highlight the needed series.
I have have found 2 options to sent the color using properties
.Interior.Color
- OR
.Format.Fill.ForeColor.SchemeColor
But there I used RGB color model to set a color.
How can I come back to "Automatic" color, that is default color in my chart template. What value should I assign to the properties above?
Thanks!
I have used: .Interior.Color = xlNone
I'm using EXCEL2010. To reset in automatic my bars colour I use this syntax:
Where istogramma is the name of my series
Is it a custom chart template? If so, you may have a custom list of RGB values for the template.
Otherwise you may simply use the default colors of the workbook theme.
This code reapplies the six default workbook theme colors to the chart. If there are more than six series, the theme colors repeat. Excel also changes the brightness for subsequent sets of six series, but I have not bothered. If you need to adjust brightness, I can come back implement it.
Edit: It turns out that we can use the deprecated but still working syntax from Excel 2003 to reapply the automatic formatting to a chart series: