LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Improve 'Windows(workbook.xls).Activate" statement


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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to Activate "Show all" in a Protected Shared Workbook Anahid Excel Discussion (Misc queries) 1 November 27th 09 01:44 PM
Can I keep "Windows of active workbook check box" checked SueH Excel Discussion (Misc queries) 1 February 15th 07 07:38 PM
Workbook.Activate / Window.Activate problem Tim[_44_] Excel Programming 3 February 3rd 06 11:38 PM
Activate "current workbook" Darin Kramer Excel Programming 4 September 23rd 05 01:28 PM
Call a sub statement in "Personal Macro Workbook" from "ThisWorkbo QC Coug Excel Programming 1 August 26th 05 07:09 PM


All times are GMT +1. The time now is 12:05 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"