View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.charting
SiriS
 
Posts: n/a
Default Trying to change ColorIndex for series settings


Hi,

I have a graph containing a variable amount of series with
Border.ColorIndex=xlAutomatic.

I would like
the colorindex of the 4th series to be the same as the first series,
the colorindex of the 5th series to be the same as the second series,
the colorindex of the 6th series to be the same as the third series,
the colorindex of the 7th series to be the same as the first series,
the colorindex of the 8th series to be the same as the second series,
and so on.

The periodicity of the colorindex varies, I mean, it varies how many
colors that shall be used.

How to do this in VBA code?

I have tried this


Code:
--------------------
For i = 1 To numOfSeries
For j = 1 To numOfDifferentColors
If i numOfDifferentColors Then
ActiveChart.SeriesCollection(numOfDifferentColors * (i - 1) + j).Select
With Selection.Border
.ColorIndex = ActiveChart.SeriesCollection(j).Border.ColorIndex
End With
With Selection
.MarkerBackgroundColorIndex = ActiveChart.SeriesCollection(j).MarkerBackgroundCo lorIndex
.MarkerForegroundColorIndex = ActiveChart.SeriesCollection(j).MarkerForegroundCo lorIndex
.MarkerStyle = ActiveChart.SeriesCollection(j).MarkerStyle
End With
End If
Next
Next
--------------------


but since the colorIndex is xlAutomatic for the first series, all
series only gets the xlAutomatic colorindex setting...

Any ideas??

Regards,
Siri


--
SiriS
------------------------------------------------------------------------
SiriS's Profile: http://www.excelforum.com/member.php...fo&userid=7995
View this thread: http://www.excelforum.com/showthread...hreadid=521686