Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Copy and paste versus copy and insert copied cells | New Users to Excel | |||
Copy/Paste how to avoid the copy of formula cells w/o calc values | Excel Discussion (Misc queries) | |||
EXCEL FILE a copy/a copy/a copy ....filename | New Users to Excel | |||
How copy format, font, color and border without copy/paste? | Excel Programming | |||
Range COPY function - how to copy VALUES and not formulas | Excel Programming |