PDA

View Full Version : Clearing a Shape from a Chart



ronjon65
07-27-2018, 02:37 PM
The following sub adds a circle (Oval 1) as a marker on the chart (x-y scatter). However, I can not figure out how remove Oval 1 once there.

Also, sometimes there may not be any data in some of the series (blank cells) and the oval does not show for this (no prob), but Oval 1 still resides and shows when there is data back again. I need to be able to clear out Oval 1 even if the cells are blank.


Sub Test()

ActiveSheet.Shapes("Oval 1").Select
Selection.Copy
ActiveSheet.ChartObjects("Chart_A").Activate


ActiveChart.SeriesCollection(1).Paste
ActiveChart.SeriesCollection(2).Paste
ActiveChart.SeriesCollection(3).Paste
ActiveChart.SeriesCollection(4).Paste
ActiveChart.SeriesCollection(5).Paste
ActiveChart.SeriesCollection(6).Paste
ActiveChart.SeriesCollection(7).Paste
ActiveChart.SeriesCollection(8).Paste
ActiveChart.SeriesCollection(9).Paste
ActiveChart.SeriesCollection(10).Paste

End Sub