I am trying to apply a formatted data label to all series in a pivot chart. I can do it if i name the series as noted below, but haven't been able to find a loop or a command to apply to all the series in the chart.
Here's what I have for applying to a single series, which works:
ThisWorkbook.Worksheets("WaterFall TPut").ChartObjects("waterfall throughput").Activate
ActiveChart.SeriesCollection(1).Select
ActiveChart.SeriesCollection(1).ApplyDataLabels
ActiveChart.SeriesCollection(1).DataLabels.ShowValue = True
ActiveChart.SeriesCollection(1).DataLabels.Select
Selection.NumberFormat = "0%;-0%;"
And here was my attempt at looping something similar, which I've played around with endlessly with no success:
Public Sub LoopThroughSeries()
Dim myChart As ChartObject
Dim mySeries As Series
With myChart
For Each mySeries In myChart.Chart.SeriesCollection
ActiveChart.SeriesCollection().ApplyDataLabels
ActiveChart.SeriesCollection().DataLabels.ShowValue = True
ActiveChart.SeriesCollection().DataLabels.Select
Selection.NumberFormat = "0%;-0%;"
Next
End With
End Sub
PLEASE HELP! I would think this would be simple, and with "FullSeriesCollection" post 2010 i think it would be.
Here's what I have for applying to a single series, which works:
ThisWorkbook.Worksheets("WaterFall TPut").ChartObjects("waterfall throughput").Activate
ActiveChart.SeriesCollection(1).Select
ActiveChart.SeriesCollection(1).ApplyDataLabels
ActiveChart.SeriesCollection(1).DataLabels.ShowValue = True
ActiveChart.SeriesCollection(1).DataLabels.Select
Selection.NumberFormat = "0%;-0%;"
And here was my attempt at looping something similar, which I've played around with endlessly with no success:
Public Sub LoopThroughSeries()
Dim myChart As ChartObject
Dim mySeries As Series
With myChart
For Each mySeries In myChart.Chart.SeriesCollection
ActiveChart.SeriesCollection().ApplyDataLabels
ActiveChart.SeriesCollection().DataLabels.ShowValue = True
ActiveChart.SeriesCollection().DataLabels.Select
Selection.NumberFormat = "0%;-0%;"
Next
End With
End Sub
PLEASE HELP! I would think this would be simple, and with "FullSeriesCollection" post 2010 i think it would be.