开发者

How to change chart colors in VBA

I have to change the colors of a pie chart in VBA. I 'managed' to change the font color, which is not what I wanted, this way:

ActiveChart.Legend.开发者_JS百科LegendEntries(1).Border.ColorIndex = 6

I want to change the color of the actual piece of pie. I also have to set specific colors, which are part of the standard palette. The 6 above gives me a flashy yellow but I want the colors highlighted here

How to change chart colors in VBA


When faced with problems like this, I usually record a macro and examine what Excel does. I'd try this:

ActiveChart.SeriesCollection(1).Points(1).Interior.ColorIndex = 6

For colors, check out the RGB(red,green,blue) function.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜