开发者

How to change chart colors in VBA

开发者 https://www.devze.com 2022-12-15 05:09 出处:网络
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:

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

精彩评论

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