Copying and pasting logarithmic trend line from chart into cell

Lguan

New Member
Joined
Mar 2, 2018
Messages
1
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!
 

Excel Facts

Workdays for a market open Mon, Wed, Friday?
Yes! Use "0101011" for the weekend argument in NETWORKDAYS.INTL or WORKDAY.INTL. The 7 digits start on Monday. 1 means it is a weekend.
Does this work?

Code:
Range("C35").value = ActiveChart.FullSeriesCollection(1).Trendlines(1).DataLabel.Value
 
Upvote 0

Forum statistics

Threads
1,223,231
Messages
6,170,885
Members
452,364
Latest member
springate

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top