Nick_London
08-25-2010, 09:16 AM
Hello All,
I have the following macro below that I use to update all charts on the activesheet however I only want to apply it most charts but not all. Is there a way I can exclude it running on specified charts.
For example I want to exclude the charts below from being impacted by the macro:
ActiveSheet.ChartObjects("Chart 8")
ActiveSheet.ChartObjects("Chart 17")
Is it possible to do this?
Many thanks for help in advance,
Nick
Sub Refresh_Charts_test2()
Dim ch As ChartObject
Dim i As Long
For Each ch In ActiveSheet.ChartObjects
ch.Select
For i = 1 To ActiveChart.SeriesCollection.Count
ActiveChart.SeriesCollection(i).Values = Worksheets("Data").Range(D10: D120)
ActiveChart.SeriesCollection(i).XValues = Worksheets("Data").Range(A10:A120)
Next i 'series in the chart
Next ch 'next chart
End Sub
I have the following macro below that I use to update all charts on the activesheet however I only want to apply it most charts but not all. Is there a way I can exclude it running on specified charts.
For example I want to exclude the charts below from being impacted by the macro:
ActiveSheet.ChartObjects("Chart 8")
ActiveSheet.ChartObjects("Chart 17")
Is it possible to do this?
Many thanks for help in advance,
Nick
Sub Refresh_Charts_test2()
Dim ch As ChartObject
Dim i As Long
For Each ch In ActiveSheet.ChartObjects
ch.Select
For i = 1 To ActiveChart.SeriesCollection.Count
ActiveChart.SeriesCollection(i).Values = Worksheets("Data").Range(D10: D120)
ActiveChart.SeriesCollection(i).XValues = Worksheets("Data").Range(A10:A120)
Next i 'series in the chart
Next ch 'next chart
End Sub