ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Copy ata from several workbooks and paste into new work book (https://www.excelbanter.com/excel-programming/338913-copy-ata-several-workbooks-paste-into-new-work-book.html)

[email protected]

Copy ata from several workbooks and paste into new work book
 
Hi All,

I am trying to copy a range of data from a series of opened workbooks
and paste them into a new workbook? How can I do this? So far, I've
figured out how to copy the range I want from one notebook, but that's
all. Here is my code for this:

Sub Macro1()
Range("A6", Range("A6").End(xlDown).End(xlToRight)).Select
Selection.Copy
End Sub

Thanks in advanced for any help.


NickHK

Copy ata from several workbooks and paste into new work book
 
mchangun,
Record a macro whilst performing the desired actions.
Edit the code as necessary.

NickHK

wrote in message
ups.com...
Hi All,

I am trying to copy a range of data from a series of opened workbooks
and paste them into a new workbook? How can I do this? So far, I've
figured out how to copy the range I want from one notebook, but that's
all. Here is my code for this:

Sub Macro1()
Range("A6", Range("A6").End(xlDown).End(xlToRight)).Select
Selection.Copy
End Sub

Thanks in advanced for any help.




[email protected]

Copy ata from several workbooks and paste into new work book
 
Recording a marco helps with the paste part of the code, but doesn't
help me with looping through the opened workbooks.


NickHK

Copy ata from several workbooks and paste into new work book
 
mchangun,
Dim WB as Workbook

For each WB in workbooks
...code
Next

NickHK

wrote in message
ups.com...
Recording a marco helps with the paste part of the code, but doesn't
help me with looping through the opened workbooks.





All times are GMT +1. The time now is 05:48 AM.

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