ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Copying A Worksheet From Each Open Workbook to an new Workbook (https://www.excelbanter.com/excel-worksheet-functions/62851-copying-worksheet-each-open-workbook-new-workbook.html)

carl

Copying A Worksheet From Each Open Workbook to an new Workbook
 
I have multiple workbooks each containing 1 worksheet that I would like to
copy into 1 workbook. I recorded this macro to show the commands used to copy
one of the worksheets the workbook "Summary.xls".

Sub temp()
Windows("throttling 20051220.xls").Activate
Sheets("throttling 20051220").Select
Sheets("throttling 20051220").Copy
Befo=Workbooks("Summary.xls").Sheets(1)
End Sub

Is it possible to modify or change the macro so it will perform the copy
into "Summary.xls" for each workbook that is open, and for each of these
workbooks copy the workshhet that starts with the word "throttling", and to
carry the name of the original worksheet "throttling 20051220" to the copied
worksheet in my workbook named "Summary".

Thank you in advance.


Duke Carey

Copying A Worksheet From Each Open Workbook to an new Workbook
 
something like...

Dim wb As Workbook

For Each wb In Workbooks
if wb.name < "Summary.xls" then
wb.sheets(1).copy Befo=Workbooks("Summary.xls").Sheets(1)
end if
Next


"carl" wrote:

I have multiple workbooks each containing 1 worksheet that I would like to
copy into 1 workbook. I recorded this macro to show the commands used to copy
one of the worksheets the workbook "Summary.xls".

Sub temp()
Windows("throttling 20051220.xls").Activate
Sheets("throttling 20051220").Select
Sheets("throttling 20051220").Copy
Befo=Workbooks("Summary.xls").Sheets(1)
End Sub

Is it possible to modify or change the macro so it will perform the copy
into "Summary.xls" for each workbook that is open, and for each of these
workbooks copy the workshhet that starts with the word "throttling", and to
carry the name of the original worksheet "throttling 20051220" to the copied
worksheet in my workbook named "Summary".

Thank you in advance.



All times are GMT +1. The time now is 10:30 AM.

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