View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
[email protected] conorfinnegan@gmail.com is offline
external usenet poster
 
Posts: 28
Default Edit Chart Macro Help - Skip ActiveChart Selection if no data

I have a macro that I have recorded. I know there is some duplicate
information here, but I am not worried about that. I have included a
part of the code below. Basically if the "SeriesCollection" is not
available on the chart for which I run the macro, the macro fails and
gives me a runtime error. So in the example below, if
SeriesCollection(3) doesn't have data, I would like it to jump to
SeriesCollection(4). Is there a way to do that? Can anyone please
help?

I would greatly appreciate it.

Conor

ActiveChart.SeriesCollection(3).Select
With Selection.Border
.ColorIndex = 10
.Weight = xlMedium
.LineStyle = xlContinuous
End With
With Selection
.MarkerBackgroundColorIndex = xlNone
.MarkerForegroundColorIndex = xlNone
.MarkerStyle = xlNone
.Smooth = False
.MarkerSize = 3
.Shadow = False
End With
ActiveChart.SeriesCollection(4).Select
With Selection.Border
.ColorIndex = 10
.Weight = xlMedium
.LineStyle = xlDash
End With