I ianripping Jan 15, 2004 #1 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?
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?
I ianripping Jan 15, 2004 #2 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
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
B Bob Phillips Jan 15, 2004 #3 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)
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)