The code below works and sets the color of the four lines with the three values for rgb. The three rgb values are filled in an array (Clr) which is not very clear. Is there an alternative way for instant by using Hex numbers, ColorIndex or the predefined colors like vbBlack?
Sub CreateChart()
Dim i As Long
Dim j As Long
Dim Clr() As Variant
'Clr = Array("vbBlack", "vbBlue", "vbRed", "vbCyan", "vbGreen", "vbMagenta") ' colors as types
'Clr = Array("&H0", "&HFF0000", "&Hff", "&HFFFF00", "&HFF00", "&HFF00FF") ' Hex of colors as String
'Clr = Array(&H0, &HFF0000, &HFF, &HFFFF00, &HFF00, &HFF00FF) ' Hex Values of colors
'Clr = Array(&H0, &HFF0000, &HFF, &HFFFF00, &HFF00, &HFF00FF) ' IndexColor
Clr = Array(0, 0, 0, 0, 0, 255, 255, 0, 0, 0, 255, 255, 0, 255, 0, 255, 0, 255)
With Charts.Add
.ChartType = xlXYScatterLinesNoMarkers
.SetSourceData Source:=Sheets("Plot").Range("A12:E213")
j = 0
For i = 2 To 5
With .FullSeriesCollection(i - 1).Format.Line
.ForeColor.RGB = RGB(Clr(j), Clr(j + 1), Clr(j + 2))
j = j + 3
End With
Next
End With
End Sub