Hi All,
I have the following code that applies the required formatting to each field in my pivot chart:
This works great however I would now also like to add data labels in a specific format for 2 of the cases ("Rejected - Outside Agreed Timeframe" and "Paid") whilst leaving the other two blank.
I have this code:
Which is the correct format I want the data labels to appear in, I'm just confused as to what needs changing and where I need to put it on the first piece of code to make it work... any ideas?
Thanks in advance
I have the following code that applies the required formatting to each field in my pivot chart:
Code:
Sub COBA()
Dim i As Long
Sheets("Claim Outcomes by Agent").Select
ActiveSheet.ChartObjects("Chart 1").Activate
ActiveChart.PlotArea.Select
With ActiveChart
For i = 1 To .SeriesCollection.Count
With .SeriesCollection(i).Format.Fill
Select Case .Parent.Parent.Name
Case "Paid"
.Visible = msoTrue
.ForeColor.RGB = RGB(0, 128, 0)
.Transparency = 0
.Solid
Case "Pending - Details sent to FedEx"
.Visible = msoTrue
.ForeColor.RGB = RGB(255, 204, 0)
.Transparency = 0
.Solid
Case "Rejected - Outside Agreed Timeframe"
.Visible = msoTrue
.ForeColor.RGB = RGB(255, 0, 0)
.Transparency = 0
.Solid
Case "Rejected < £20.00"
.Visible = msoTrue
.ForeColor.RGB = RGB(246, 197, 192)
.Transparency = 0
.Solid
End Select
End With
Next i
End With
This works great however I would now also like to add data labels in a specific format for 2 of the cases ("Rejected - Outside Agreed Timeframe" and "Paid") whilst leaving the other two blank.
I have this code:
Code:
ActiveChart.SeriesCollection(1).Select
ActiveChart.SeriesCollection(1).ApplyDataLabels
ActiveChart.SeriesCollection(1).DataLabels.Select
Selection.Position = xlLabelPositionInsideEnd
Selection.NumberFormat = "\£0;;;"
Which is the correct format I want the data labels to appear in, I'm just confused as to what needs changing and where I need to put it on the first piece of code to make it work... any ideas?
Thanks in advance