magnel
04-16-2016, 05:55 AM
Hello,
I am using PPT 2010 and I am trying to put together a piece of code which colors only the selected line in the charts.
Here is the code which I am using:
Sub LineChart()
On Error Resume Next
With ActiveWindow.Selection.ShapeRange(1).Chart
.SeriesCollection(1).Format.Line.ForeColor.RGB = RGB(225, 215, 214)
.SeriesCollection(1).Format.Fill.ForeColor.RGB = RGB(225, 215, 214)
.SeriesCollection(2).Format.Line.ForeColor.RGB = RGB(231, 228, 223)
.SeriesCollection(2).Format.Fill.ForeColor.RGB = RGB(231, 228, 223)
.SeriesCollection(3).Format.Line.ForeColor.RGB = RGB(226, 233, 205)
.SeriesCollection(3).Format.Fill.ForeColor.RGB = RGB(226, 233, 205)
.SeriesCollection(4).Format.Line.ForeColor.RGB = RGB(240, 238, 217)
.SeriesCollection(4).Format.Fill.ForeColor.RGB = RGB(240, 238, 217)
End With
End Sub
This code colors all the Lines in the Line Chart, but I am not able to select a particular Line and color it.
Please can someone help me with some modification to the above code which will color only the selected line.
Thanks
I am using PPT 2010 and I am trying to put together a piece of code which colors only the selected line in the charts.
Here is the code which I am using:
Sub LineChart()
On Error Resume Next
With ActiveWindow.Selection.ShapeRange(1).Chart
.SeriesCollection(1).Format.Line.ForeColor.RGB = RGB(225, 215, 214)
.SeriesCollection(1).Format.Fill.ForeColor.RGB = RGB(225, 215, 214)
.SeriesCollection(2).Format.Line.ForeColor.RGB = RGB(231, 228, 223)
.SeriesCollection(2).Format.Fill.ForeColor.RGB = RGB(231, 228, 223)
.SeriesCollection(3).Format.Line.ForeColor.RGB = RGB(226, 233, 205)
.SeriesCollection(3).Format.Fill.ForeColor.RGB = RGB(226, 233, 205)
.SeriesCollection(4).Format.Line.ForeColor.RGB = RGB(240, 238, 217)
.SeriesCollection(4).Format.Fill.ForeColor.RGB = RGB(240, 238, 217)
End With
End Sub
This code colors all the Lines in the Line Chart, but I am not able to select a particular Line and color it.
Please can someone help me with some modification to the above code which will color only the selected line.
Thanks