Trendline equation positioning

  • Thread starter Thread starter mike hutchins
  • Start date Start date
M

mike hutchins

Is it possible to specify (using VBA I guess) the positioning of the
trendline equation that can be displayed on a chart?

The reason is that, it seems, when the chart's source data changes and
re-scaling occurs, the equation gets moved around the chart. If
several trendlines are displayed they often overlap.

I'd like to define where each trendline equation appears to prevent
this.

Cheers......Mike
 
Hi Mike,
You can learn a lot of VBA by using Tools|Macros|Record macro.
Here are two I recorded.

Sub Macro1()
'
' Macro1 Macro
' Macro recorded 14/01/2004 by Bernard Liengme
'
ActiveChart.Legend.Select
Selection.Left = 12
Selection.Top = 8
End Sub

Sub Macro2()
' Macro2 Macro
' Macro recorded 14/01/2004 by Bernard Liengme
ActiveSheet.ChartObjects("Chart 1").Activate
ActiveChart.HasLegend = True
ActiveChart.Legend.Select
Selection.Position = xlRight
End Sub

Best wishes
 
Back
Top