PDA

View Full Version : How to copy data from one Excel file to another very fast?



jiura
12-14-2007, 12:35 PM
Hello to all!
I have two excel files and want to copy data from one file to another. My copping array in first file is not continual in other words I have a lot of rectangles of data in Excel Sheets. How can I copy all this rectangles (I know their address) most quickly to other Excel file?

mikerickson
12-14-2007, 01:49 PM
If myDiscontinousRange is on one sheet, this code will put the data in the same cells on Sheet2 of theOtherBook.


Dim oneArea as Range
For Each oneArea in myDiscontinousRange.Areas
Workbooks("theOtherBook.xls").Sheets("sheet2").Range(oneArea.Address).Value = oneArea.Value
Next oneArea