Mega Code Archive

 
Categories / VisualBasic Script / Excel
 

Formats the trendline for the first series in a chart

Sub FormatLineOrBorders()     Dim myChart As Chart     Set myChart = ActiveChart     With myChart.SeriesCollection(1).Trendlines(1).Format.Line         .DashStyle = msoLineLongDashDotDot         .ForeColor.RGB = RGB(50, 0, 128)         .BeginArrowheadLength = msoArrowheadShort         .BeginArrowheadStyle = msoArrowheadOval         .BeginArrowheadWidth = msoArrowheadNarrow         .EndArrowheadLength = msoArrowheadLong         .EndArrowheadStyle = msoArrowheadTriangle         .EndArrowheadWidth = msoArrowheadWide     End With End Sub