Hello good people,
I'm trying to copy and paste a log trend line from a chart into a cell. A sample equation is as follows: y = 0.0083ln(x) - 0.0902. As I run the regression for different datapoints, the equation constantly changes. Hence, I'd like the macro to copy and paste the equation into a cell. The following code does not work when the equation changes (i.e., it does the very first time, but after that, I get an error). The code is as follows:
ActiveChart.FullSeriesCollection(1).Trendlines(1).DataLabel.Select
Selection.Copy
Range("C35").Select
ActiveSheet.Paste
Excel shows that the error is on "ActiveSheet.Paste". I would really appreciate some guidance on how to resolve the issue.
Thanks!
I'm trying to copy and paste a log trend line from a chart into a cell. A sample equation is as follows: y = 0.0083ln(x) - 0.0902. As I run the regression for different datapoints, the equation constantly changes. Hence, I'd like the macro to copy and paste the equation into a cell. The following code does not work when the equation changes (i.e., it does the very first time, but after that, I get an error). The code is as follows:
ActiveChart.FullSeriesCollection(1).Trendlines(1).DataLabel.Select
Selection.Copy
Range("C35").Select
ActiveSheet.Paste
Excel shows that the error is on "ActiveSheet.Paste". I would really appreciate some guidance on how to resolve the issue.
Thanks!