LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default Trendline color format bug/issue?

I want to change the trendlines color/type/width to match the data series
line color. i have this vb code which works well and changes type and width
but not color. what i found was that to make this work, first, i need to
manually change the color of trendlines and then run the macro.. i don;t know
if this is a bug or something i am not doing properly

Sub change_trendlines()
Dim mysrcolor, myset As ColorFormat
Dim ch1 As ChartObject
Dim series1 As Series
Dim trend1 As Trendline
Dim myline As LineFormat


For Each ch1 In ActiveSheet.ChartObjects
ch1.Activate
For Each series1 In ActiveChart.SeriesCollection
Set mysrcolor = series1.Format.Line.ForeColor
For Each trend1 In series1.Trendlines
Set myline = trend1.Format.Line
myline.DashStyle = msoLineDash
myline.Weight = 2
myline.ForeColor.RGB = mysrcolor.RGB
Next trend1
Next series1
ch1.Activate
Next ch1

End Sub

any help on this is highly appreciated
 
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
Excel 2003 Conditional Format Color Cells Issue in SharePoint 3.0 G_man Excel Discussion (Misc queries) 0 May 21st 09 05:09 PM
different color on scatter plot separated by a trendline Laoballer Charts and Charting in Excel 1 January 31st 09 08:03 AM
Color issue the process Excel Discussion (Misc queries) 1 January 15th 07 10:50 PM
Changing trendline color and weight biosci Excel Programming 2 March 26th 06 11:58 PM
how to create a multiple-color trendline in excel? zibel_boy Charts and Charting in Excel 1 August 3rd 05 12:42 PM


All times are GMT +1. The time now is 11:36 PM.

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

About Us

"It's about Microsoft Excel"