I don't think that you can change individual data points (or, at least I don't know how). I think that the problem lies in checking for "compliant colors." This type of color property seems to require a Long value which corresponds to a color.
This code worked for me (Excel 2007) on a line-chart in chart I created for a project (I added the Debug.Print
lines to show the numbers returned for Series in my chart)...
Sub formatTable()
Dim wb As Workbook
Dim ws As Worksheet
Dim co As ChartObject
Dim c As Integer
Set wb = ActiveWorkbook
Set ws = wb.Sheets("Sheet1")
Set co = ws.ChartObjects("Chart1")
With co.Chart
Debug.Print .Name
For c = 1 To .SeriesCollection.Count
Debug.Print .SeriesCollection(c).Name
Debug.Print "Foreground Color: " & .SeriesCollection(c).MarkerForegroundColorIndex 'Get Forground Color
Debug.Print "Background Color: " & .SeriesCollection(c).MarkerBackgroundColorIndex ' Get Background color
.SeriesCollection(c).MarkerForegroundColorIndex = 5 'Set foreground to Blue
.SeriesCollection(c).MarkerBackgroundColorIndex = 42 ' Set background to Lt Blue
Next c
End With
End Sub
After re-reading your question, I dug a little deeper to see how to check or set the color for a Point
. All you should need to do is embed another FOR
loop inside of the above code. The important thing in this line is to use: .SeriesCollection(c).Points.Item(i).Marker... = Value