Programmatically retrieving constants
Sub test()
Dim i As Long
Dim nStyle As Long
Dim cht As Chart
Dim sr As Series
Dim arr
arr = Array(xlContinuous, xlDash, xlDot, xlDashDot, xlDashDotDot, _
xlGray25, xlGray50, xlGray75)
Set cht = ActiveSheet.ChartObjects(1).Chart
nStyle = LBound(arr)
For i = 1 To cht.SeriesCollection.Count
Set sr = cht.SeriesCollection(i)
sr.Border.LineStyle = arr(nStyle)
If nStyle = UBound(arr) Then
nStyle = LBound(arr)
Else: nStyle = nStyle + 1
End If
Next
End Sub
Not sure about those Grays though
Regards,
Peter T
"Matthew Norman" wrote in message
...
Hi,
I want to loop through all the series on my chart and change the line
style to possibilities...
the allowed constants a
XlContinuous
XlDash
xlDashDot
xlDot
etc
xlContinuous has a value of 1, xlDash has a value of -4115 etc...
Is there any way of looping through the allowed values, and therefore
assigning the "next" constant to the dataseries being processed???
|