Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Determine real colour of automatic line colours?

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?
  #2   Report Post  
Posted to microsoft.public.excel.programming
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?

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Determine real colour of automatic line colours?

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


Thanks for the help, but I know how to change the colours; the question
is how to find out the actual colour assigned to a series that has its
ColorIndex property set as xlAutomatic. I could then use that information to
calculate a darker colour and assign that to the associated trendline colour.

I've gone for manually assigning known colours to the series and trendlines,
from an array that I have set up initially, so it's now more of a question
out of curiosity, but it would be nice to know.
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Automatic chart colours Nige Danton[_2_] Excel Worksheet Functions 2 October 6th 09 06:07 AM
can't see font colours and fill colour on screen Susan Setting up and Configuration of Excel 1 February 1st 08 07:05 AM
determine cell colour Michael Excel Discussion (Misc queries) 2 March 22nd 07 03:09 PM
Format colour of cells based on other cell - 34 colours Graham Tritton Excel Programming 2 July 14th 06 03:10 AM
How do you select the colours on Microsoft excel colour pallets? [email protected] Excel Discussion (Misc queries) 1 May 11th 06 12:27 AM


All times are GMT +1. The time now is 11:28 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"