enfantter
02-22-2008, 02:19 AM
Hi all,
Im trying to write macro that colors curves according to priority.
here is my code:
'1. graf
ActiveChart.SeriesCollection(1).Select
With Selection.Border
.ColorIndex = 1
.Weight = xlMedium
.LineStyle = xlContinuous
End With
'2. graf
ActiveChart.SeriesCollection(2).Select
With Selection.Border
.ColorIndex = 55
.Weight = xlMedium
.LineStyle = xlContinuous
End With
The problem is that if there is only one curve the macro brakes down.
Therefore, i only want to run the second part (2. graf) if there is a second curve.
I've tried something like this:
if activeChart.seriescollection(2).count > 0
then ...
end if
Im trying to write macro that colors curves according to priority.
here is my code:
'1. graf
ActiveChart.SeriesCollection(1).Select
With Selection.Border
.ColorIndex = 1
.Weight = xlMedium
.LineStyle = xlContinuous
End With
'2. graf
ActiveChart.SeriesCollection(2).Select
With Selection.Border
.ColorIndex = 55
.Weight = xlMedium
.LineStyle = xlContinuous
End With
The problem is that if there is only one curve the macro brakes down.
Therefore, i only want to run the second part (2. graf) if there is a second curve.
I've tried something like this:
if activeChart.seriescollection(2).count > 0
then ...
end if