View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.charting
Shane Devenshire[_2_] Shane Devenshire[_2_] is offline
external usenet poster
 
Posts: 3,346
Default SeriesCollection - Incorrect ColorIndex Assigned to Chart

Hi,

Of course there are only 56 colors on the 2003 pallette to which the
ColorIndex applies.

--
If this helps, please click the Yes button.

Cheers,
Shane Devenshire


"Bob Barnes" wrote:

Has anyone encountered this? TIA - Bob

Sub ColorBySeriesName()
Dim rPatterns As Range
Dim iSeries As Long
Dim rSeries As Range
Set rPatterns = ActiveSheet.Range("A1:H66")
With ActiveSheet.ChartObjects("Chart 1").Chart
For iSeries = 1 To .SeriesCollection.Count
Set rSeries = rPatterns.Find(What:=.SeriesCollection(iSeries).Na me)
If Not rSeries Is Nothing Then
'Gets near end of the SeriesCollection (56th of 66) & doesn't assign
correct
'ColorIndex
.SeriesCollection(iSeries).Interior.ColorIndex =
rSeries.Interior.ColorIndex
End If
Next
End With
End Sub