Nicky -
The series itself has no colorindex property. For a line or scatter
chart, you have three colors to set:
Sub set_series_colors()
ActiveChart.SeriesCollection(1).MarkerForegroundColorIndex = 25
ActiveChart.SeriesCollection(1).MarkerBackgroundColorIndex = 25
ActiveChart.SeriesCollection(1).Border.ColorIndex = 25
ActiveChart.SeriesCollection(2).MarkerForegroundColorIndex = 4
ActiveChart.SeriesCollection(2).MarkerBackgroundColorIndex = 4
ActiveChart.SeriesCollection(2).Border.ColorIndex = 4
End Sub
For chart types with a fill (area, column, bar, etc), there are only two:
Sub set_series_colors()
ActiveChart.SeriesCollection(1).Interior.ColorIndex = 25
ActiveChart.SeriesCollection(1).Border.ColorIndex = 25
ActiveChart.SeriesCollection(2).Interior.ColorIndex = 4
ActiveChart.SeriesCollection(2).Border.ColorIndex = 4
End Sub
The easiest way to figure these out, in fact the way I did it myself, is
to turn on the macro recorder and see what it spits out.
- Jon
-------
Jon Peltier, Microsoft Excel MVP
Peltier Technical Services
Tutorials and Custom Solutions
http://PeltierTech.com/
_______