ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   MarkerBackgroundColorIndex = xlAutomatic (https://www.excelbanter.com/excel-programming/310283-markerbackgroundcolorindex-%3D-xlautomatic.html)

Dr.Schwartz

MarkerBackgroundColorIndex = xlAutomatic
 
If I create a chart in my code and I do not specifically set the
MarkerBackgroundColorIndex for the series it is set to xlAutomatic by default.

How can I extract the actual colorindex that excel chooses?

Debug.Print ActiveChart.SeriesCollection(I).MarkerBackgroundCo lorIndex

just gives me the code for xlAutomatic (-4105 I believe).

Thanks
The Doctor

Peter T[_3_]

MarkerBackgroundColorIndex = xlAutomatic
 
In a bog standard chart, xlAutomatic (-4105) colours for
series lines are applied in series order starting at with
the colour assigned to colorindex 25.

So the automatic colour, both for the line and markers in
Series 3, where series 3 was the third series created,
would (normally) be the same as #27. If a series is
deleted and a new one added, the auto colour takes the
first unused colorindex from #25 on. There are one or two
other things that can contradict what I've described.

With Bar type series and those that can be "filled",
automatic colours start at #17.

In a chart with a single series with "Vary colors by
point", again automatic point colors are applied starting
from #25.

Regards,
Peter



-----Original Message-----
If I create a chart in my code and I do not specifically

set the
MarkerBackgroundColorIndex for the series it is set to

xlAutomatic by default.

How can I extract the actual colorindex that excel

chooses?

Debug.Print ActiveChart.SeriesCollection

(I).MarkerBackgroundColorIndex

just gives me the code for xlAutomatic (-4105 I believe).

Thanks
The Doctor
.



All times are GMT +1. The time now is 10:10 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com