ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Copying data across 2 xcel files (https://www.excelbanter.com/excel-programming/284580-copying-data-across-2-xcel-files.html)

Gandei

Copying data across 2 xcel files
 
Hi there

I have 2 separate xcel files and want to copy columns A:D
of file1 into A:D of file2.
To copy across different sheets in the same file I would do
Sheet1.Range("A:D").Value = Sheet2.Range("A:D").Value

Is there a way to copy across 2 different xcel files in a
simliar manner show above, so that I would avoid the use
of clip board.
Currently I'm copying them using clip board as shown below:

Workbooks("File1.xls").Activate
Range("A:D").Select
Selection.Copy
Workbooks("File2.xls").Activate
Range("A:D").PasteSpecial
Application.CutCopyMode = False 'Clears wriggly worms


Thanks
Gandei

Tom Ogilvy

Copying data across 2 xcel files
 

workbooks("File2.xls").Sheet1.Range("A:D").Value = _
Workbooks("File1.xls").Sheet2.Range("A:D").Value

--

Regards,
Tom Ogilvy

"Gandei" wrote in message
...
Hi there

I have 2 separate xcel files and want to copy columns A:D
of file1 into A:D of file2.
To copy across different sheets in the same file I would do
Sheet1.Range("A:D").Value = Sheet2.Range("A:D").Value

Is there a way to copy across 2 different xcel files in a
simliar manner show above, so that I would avoid the use
of clip board.
Currently I'm copying them using clip board as shown below:

Workbooks("File1.xls").Activate
Range("A:D").Select
Selection.Copy
Workbooks("File2.xls").Activate
Range("A:D").PasteSpecial
Application.CutCopyMode = False 'Clears wriggly worms


Thanks
Gandei





All times are GMT +1. The time now is 12:33 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com