Copying A Worksheet From Each Open Workbook to an new Workbook

G

Guest

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
Before:=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.
 
G

Guest

something like...

Dim wb As Workbook

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

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top