I am trying to use macros to copy paste the equation of a trendline from a graph to a cell. I am getting an error at Selection.copy
.
Sub Equations()
'Equations Macro
'Keyboard Shortcut: Ctrl+e
ActiveSheet.ChartObjects("Chart 1").Activate
ActiveChart.FullSeriesCollection(1).Trendlines(1).DataLabel.Select
Selection.Copy
ActiveWindow.SmallScroll Down:=3
Range("C56").Select
ActiveSheet.Paste
ActiveSheet.ChartObjects("Chart 1").Activate
ActiveChart.FullSeriesCollection(2).Trendlines(1).DataLabel.Select
Selection.Copy
Range("D56").Select
ActiveSheet.Paste
ActiveSheet.ChartObjects("Chart 1").Activate
ActiveChart.FullSeriesCollection(3).Trendlines(1).DataLabel.Select
Selection.Copy
Range("E56").Select
ActiveSheet.Paste
ActiveSheet.ChartObjects("Chart 1").Activate
ActiveChart.FullSeriesCollection(4).Trendlines(1).DataLabel.Select
Selection.Copy
Range("F56").Select
ActiveSheet.Paste
ActiveSheet.ChartObjects("Chart 1").Activate
ActiveChart.FullSeriesCollection(5).Trendlines(1).DataLabel.Select
Selection.Copy
Range("G56").Select
ActiveSheet.Paste
End Sub
See Question&Answers more detail:os