Excel trendline custom equation

broken image

I've tried storing it in a string first, DoEvents, and turning Application.ScreenUpdating back on, all to no avail.

broken image

Note that slopetextboxes is an array containing the names of ~6 shape text boxes.Īs far as I know there's no way to get the trend line data label without stopping to display it. Srs.Trendlines(1).DisplayEquation = False 'Turn it back off ThisWorkbook.Worksheets('MyDataSheet').Shapes(slopetextboxes(k)). = srs.Trendlines(1).DataLabel.Text Srs.Trendlines(1).DisplayEquation = True 'Display the labels to get the value I'm attempting to get the trend line equation from the first series in my chart to a shape text box placed elsewhere on the worksheet - however, I can only get the textbox to populate correctly when I'm stepping through the code line by line - during run-time it has no effect: For Each chtObj In ActiveSheet.ChartObjectsįor Each srs In

broken image