top copy multiple sheets to new book

tourless

Board Regular
Joined
Feb 8, 2007
Messages
144
Office Version
  1. 365
Platform
  1. Windows
Hi Folks,

Like the title says, I'm trying to take three sheets from the active workbook and copy them to a new workbook, however I don't think it's as easy as
Code:
ThisWorkbook.Sheets(wsRequired1, wsRequired2, wsRequired3).Copy
. Apparently that's too many arguments. I was hoping it could be done without first having to create the new workbook separately but I'm not sure if that's possible. What are my options here?

thanks.
 

Excel Facts

Links? Where??
If Excel says you have links but you can't find them, go to Formulas, Name Manager. Look for old links to dead workbooks & delete.
Try
Code:
ThisWorkbook.Sheets(Array(wsRequired1, wsRequired2, wsRequired3)).Copy
 
Upvote 0
odd that it doesn't work with worksheet code names but non-the-less...
Code:
ThisWorkbook.Sheets(Array("Required1", "Required2", "Required3")).Copy
works perfectly.

Thanks!
 
Last edited:
Upvote 0
Glad to help & thanks for the feedback.

It doesn't work with the code name, because Sheets(...) requires a sheet name.
But you can do it like
Code:
Sheets(Array(Sheet9.name, Sheet8.name)).Copy
 
Upvote 0

Forum statistics

Threads
1,223,910
Messages
6,175,318
Members
452,634
Latest member
cpostell

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top