Greetings,
I am adding a trendline to a scatter plot and turning on the equation. I have been able to figure out how to format the datalabel of the trendline up until I want to turn on the line around the datalabel. I have tried line, lineformat, and borders. Below is the VBA code.
Cheers,
Mark.
' VBA code
ActiveChart.SeriesCollection(1).Trendlines.Add
ActiveChart.SeriesCollection(1).Trendlines(1).Select
With Selection
.Type = xlLogarithmic
.DisplayEquation = True
.DisplayRSquared = True
End With
ActiveChart.SeriesCollection(1).Trendlines(1).DataLabel.Select
With Selection
.Left = 400
.Top = 200
.NumberFormat = "0.000E+00"
End With
With Selection.Font
.Name = "Arial"
.FontStyle = "Regular"
.Size = 12
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.ColorIndex = xlAutomatic
End With
With Selection.Fill
.Solid
.ForeColor.SchemeColor = 2
End With
With Selection.Lines
.Weight = 0.75
.DashStyle = msoLineSolid
.Style = msoLineSingle
.Visible = msoTrue
.ForeColor.SchemeColor = 0
End With
ActiveChart.ChartArea.Select
Bookmarks