pedie
Well-known Member
- Joined
- Apr 28, 2010
- Messages
- 3,875
Hi everyone,
Is there a way for VBA to apply background color to Chart series. be it Pie or bar or any other chart?
Below code only work for bar charts and column charts..
Please help.
thanks all!
Is there a way for VBA to apply background color to Chart series. be it Pie or bar or any other chart?
Below code only work for bar charts and column charts..
Please help.
thanks all!
Code:
Dim i As Long
Dim oChart As Chart
Dim oSeries As Series
Dim seriesCol As SeriesCollection
Set oChart = ActiveChart
Debug.Print oChart.ChartType
Set ch = oChart.SeriesCollection
For i = 1 To ch.Count
If ch(i).Name = Selection.Name Then
Set oSeries = oChart.SeriesCollection(i)
With oSeries.Format.Fill
.ForeColor.RGB = RGB(100, 120, 127)
End With
End If
Next i