Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Hello, I have a VBA routine that creates an xy data plot on worksheet (A) and displays a regression fit in the chart textbox. I need to have the chart drawn to force visual inspection of the data, and would like to be able to copy the regression text that is displayed in the text box on the on the chart to a cell on a new worksheet (B) in the same workbook. The routine needs to be generic so that the code will run on any workbook. Using the macro recorder, I get the code below. The problem, for me, is to make the "Windows("Workbook1.xls").Activate" statement generic. Using statements such as(Windows("0").Activate have produced strange, and unpredicatebe results. Thanks for any suggestions! Hank Sub Copy_Text() ' ' ' Sheets("A").Select ActiveSheet.ChartObjects("Chart 1").Activate ActiveChart.ChartArea.Select ActiveChart.SeriesCollection(1).Trendlines(1).Data Label.Select ActiveWindow.Visible = False Windows("Workbook1.xls").Activate Sheets("B").Select Range("A1").Select ActiveSheet.Paste End Sub -- Hank ------------------------------------------------------------------------ Hank's Profile: http://www.excelforum.com/member.php...o&userid=34042 View this thread: http://www.excelforum.com/showthread...hreadid=538047 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How to Activate "Show all" in a Protected Shared Workbook | Excel Discussion (Misc queries) | |||
Can I keep "Windows of active workbook check box" checked | Excel Discussion (Misc queries) | |||
Workbook.Activate / Window.Activate problem | Excel Programming | |||
Activate "current workbook" | Excel Programming | |||
Call a sub statement in "Personal Macro Workbook" from "ThisWorkbo | Excel Programming |