Forum Discussion
WesJD
May 12, 2020Copper Contributor
Excel changes multiple series colors at once
I have a simple X-Y chart with five series of markers, no lines. When I change the color of the markers on Series 5, Series 1 also changes to the same color, and when I change Series 1 back to the co...
JonPeltier
May 04, 2021MVP
AhmedMahmoud23 This could be done with VBA. I have some dummy data, an original series plus four iterations (but it can be as many as you want, up to Excel's limit). The original chart is at top right. In "Chart Before" I have formatted the original series with a black line and the first iteration with a gray line. "Chart After" is the result of a simple VBA procedure, below the screenshot.
Sub FormatSeriesTheSame()
If ActiveChart Is Nothing Then
MsgBox "Select a chart and try again!", vbExclamation
GoTo ExitSub
End If
With ActiveChart
Dim iColor As Long
iColor = .SeriesCollection(2).Format.Line.ForeColor.RGB
Dim iSeries As Long
For iSeries = 3 To .SeriesCollection.Count
.SeriesCollection(iSeries).Format.Line.ForeColor.RGB = iColor
Next
End With
ExitSub:
End Sub
AhmedMahmoud23
May 05, 2021Copper Contributor
Thanks you for the help. It worked perfectly 🙂