View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
joel joel is offline
external usenet poster
 
Posts: 9,101
Default Determine real colour of automatic line colours?

I recorded a macro while manually changing the trend line color. this is
what I got.

Sub Macro1()
'
' Macro1 Macro
' Macro recorded 10/18/2007 by Joel
'

'
ActiveSheet.ChartObjects("Chart 1").Activate
ActiveChart.SeriesCollection(1).Trendlines(1).Sele ct
ActiveChart.SeriesCollection(1).Trendlines(1).Sele ct
With Selection.Border
.ColorIndex = 4
.Weight = xlMedium
.LineStyle = xlContinuous
End With
End Sub


"DuncanL" wrote:

I am creating a chart and adding trendlines via VBA - which is all working
marvellously.

Each series is assigned a colour automatically. What I'd like to achieve is
to set the related trendline to be a darker version of the line colour.
However I can't see a way of finding the colour assigned to the series (which
are set as xlAutomatic by Excel)

Is this possible? Or will I have to manage the colours of the series and
trends myself?