Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi All.........
If someone would please be so kind..........I am in need of code to extract the formula from the Text Box that is put there when one creates an XY Scatter chart and adds a Third-order Polynomial Trendline. I am trying to create a macro that will do this automatically and then do normal Text-to-columns and break it apart and then do the math.........I can get it all working by recording the macro, but for some reason I can't "get" the formula out of the text box, only by Cntrl-C have I been able to copy and paste it to a cell, and that doesn't "record" too well.........I know about the LINEST function, but for some reason it's answer does not jive with that from the formula from the text box...........my user wants to use the formula from the text box. Here's the code I get by recording, it seems to work for a time or two, then not.....and if I clear the trendline and change a value and make another trendline, the macro does not copy out the same formula thats in the text box........nor will it change when I increase precision of the formula.........? Sub GetTrendlineFormula() ActiveSheet.ChartObjects("Chart 4").Activate ActiveChart.SeriesCollection(1).Trendlines(1).Data Label.Select ActiveWindow.Visible = False Windows("ChartsChuck4.xls").Activate Range("N20").Select ActiveSheet.Paste Selection.TextToColumns Destination:=Range("N20"), DataType:=xlFixedWidth, _ FieldInfo:=Array(Array(0, 1), Array(2, 1), Array(10, 1), Array(12, 1), Array(20, 1), _ Array(22, 1), Array(30, 1), Array(32, 1)) Range("N24").Select End Sub Any help would be much appreciated........... Vaya con Dios, Chuck, CABGx3 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
On Sun, 6 Feb 2005 12:05:07 -0500, "CLR" wrote:
Hi All......... If someone would please be so kind..........I am in need of code to extract the formula from the Text Box that is put there when one creates an XY Scatter chart and adds a Third-order Polynomial Trendline. I am trying to create a macro that will do this automatically and then do normal Text-to-columns and break it apart and then do the math.........I can get it all working by recording the macro, but for some reason I can't "get" the formula out of the text box, only by Cntrl-C have I been able to copy and paste it to a cell, and that doesn't "record" too well.........I know about the LINEST function, but for some reason it's answer does not jive with that from the formula from the text box...........my user wants to use the formula from the text box. With regard to David Braden's code which I just posted, you will need to edit the word-wrap problems. --ron |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Extract Formula to Text | Excel Worksheet Functions | |||
formula to extract text out of a paragraph | Excel Worksheet Functions | |||
Formula to extract digits from a text string? | Excel Worksheet Functions | |||
how to extract text from a formula | Excel Discussion (Misc queries) | |||
Can I extract text as a value from a formula? | Excel Worksheet Functions |