Hello All,
WIN 7 Excel 2010
I have some code that I can get to run by stepping through but not by running macro. HELP!
code is searching for slope of a linear trendline after making chart. When it runs it errors out at the line starting with XMARK because it has NOT written the equation for the line (.DataLabel.Text)
Worksheets("Graph1").Activate
With Worksheets("Graph1").ChartObjects(1).Chart.SeriesCollection(1).Trendlines(1)
Worksheets("Graph1").Activate
Worksheets("Graph1").Cells(25, 4).Select
Selection.Value = .DataLabel.Text
End With
Worksheets("Graph1").Cells(26, 4) = Mid(Worksheets("Graph1").Cells(25, 4), 5, 100)
xmark = Application.WorksheetFunction.Find("x", Worksheets("Graph1").Cells(26, 4), 1)
Worksheets("Graph1").Cells(27, 4) = 1 * Mid(Worksheets("Graph1").Cells(26, 4), xmark + 4, 100) 'y-intercept
Worksheets("Graph1").Cells(28, 4) = Mid(Worksheets("Graph1").Cells(26, 4), 1, xmark - 1) 'slope (IACF)
Thanks for anyone willing to help.
Bookmarks