Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Copy from one to another

Can a macro copy the Information in Book1 Sheet1 Range A:B to Book 2
Sheet1 Range A:B with out Book1.xls being open?


---
Message posted from http://www.ExcelForum.com/

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Copy from one to another

I've just figured it out. Here it is for those who wondered: -

Sub Macro1()
'
' Macro1 Macro
' Macro recorded 15/01/2004 by Ian
'

'
Workbooks.Open Filename:= _
"Book2.xls"
Range("A:B").Select
Selection.Copy
Windows("Book1").Activate
Range("A:B").Select
ActiveSheet.Paste
Windows("Book2.xls").Activate
ActiveWindow.Close
Range("A1").Select
MsgBox ("Completed Copying")
End Su

--
Message posted from http://www.ExcelForum.com

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Copy from one to another

Ian,

So you figured it out as no then?

Your code can be substantiually shortened

Sub Macro1()
'
' Macro1 Macro
' Macro recorded 15/01/2004 by Ian
'

Workbooks.Open Filename:= "Book2.xls"
Range("A:B").Copy Destination:=Workbooks("Book1").Range("A:B")
Windows("Book2.xls").Close
MsgBox ("Completed Copying")
End Sub


--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"ianripping " wrote in message
...
I've just figured it out. Here it is for those who wondered: -

Sub Macro1()
'
' Macro1 Macro
' Macro recorded 15/01/2004 by Ian
'

'
Workbooks.Open Filename:= _
"Book2.xls"
Range("A:B").Select
Selection.Copy
Windows("Book1").Activate
Range("A:B").Select
ActiveSheet.Paste
Windows("Book2.xls").Activate
ActiveWindow.Close
Range("A1").Select
MsgBox ("Completed Copying")
End Sub


---
Message posted from http://www.ExcelForum.com/



Reply
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
Copy and paste versus copy and insert copied cells Alana New Users to Excel 1 September 28th 07 08:58 PM
Copy/Paste how to avoid the copy of formula cells w/o calc values Dennis Excel Discussion (Misc queries) 10 March 2nd 06 10:47 PM
EXCEL FILE a copy/a copy/a copy ....filename ve New Users to Excel 1 September 29th 05 09:12 PM
How copy format, font, color and border without copy/paste? Michel[_3_] Excel Programming 1 November 5th 03 04:43 PM
Range COPY function - how to copy VALUES and not formulas James Cooke Excel Programming 1 August 21st 03 07:04 PM


All times are GMT +1. The time now is 09:43 AM.

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

About Us

"It's about Microsoft Excel"