Hi all,
I have recorded the below macro to specify colours within a pivot chart that I plan to run when a command button is pressed. My pivot chart can contain up to three different series (Pending,Paid,Rejected) but sometimes there is only two (Paid,Rejected). Can someone please help me amend the below so that each of the series have their own specific colour, and if they are not present then they are ignored? Ideally I want the following:
Paid - Green
Pending - Orange
Rejected - Red
The macro I recorded:
Any help would be greatly appreciated
Craig
I have recorded the below macro to specify colours within a pivot chart that I plan to run when a command button is pressed. My pivot chart can contain up to three different series (Pending,Paid,Rejected) but sometimes there is only two (Paid,Rejected). Can someone please help me amend the below so that each of the series have their own specific colour, and if they are not present then they are ignored? Ideally I want the following:
Paid - Green
Pending - Orange
Rejected - Red
The macro I recorded:
Code:
Sub CWChartFormat()
'
' CWChartFormat Macro
'
'
ActiveChart.SeriesCollection(1).Select
With Selection.Format.Fill
.Visible = msoTrue
.ForeColor.RGB = RGB(0, 128, 0)
.Transparency = 0
.Solid
End With
ActiveChart.SeriesCollection(2).Select
With Selection.Format.Fill
.Visible = msoTrue
.ForeColor.RGB = RGB(255, 204, 0)
.Transparency = 0
.Solid
End With
ActiveChart.SeriesCollection(3).Select
With Selection.Format.Fill
.Visible = msoTrue
.ForeColor.RGB = RGB(255, 0, 0)
.Solid
End With
With Selection.Format.Fill
.Visible = msoTrue
.ForeColor.RGB = RGB(255, 0, 0)
.Transparency = 0
.Solid
End With
ActiveChart.SeriesCollection(1).Select
ActiveChart.SeriesCollection(3).Select
ActiveChart.SeriesCollection(3).ApplyDataLabels
ActiveChart.SeriesCollection(3).Points(0).Select
ActiveChart.SeriesCollection(3).DataLabels.Select
Selection.NumberFormat = "\£0;;;"
ActiveChart.SeriesCollection(1).Select
End Sub
Any help would be greatly appreciated
Craig