Trendline equation positioning

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
 
B

Bernard Liengme

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top