Create New Workbook from Worksheets in One Workbook

G

Guest

Hi Guys,

I'm trying to create a new workbook using sheets from another workbook,
using a macro.

I have a workbook with 8 worksheets in. I want there to be a button in this
workbook that will:

* Create a new workbook
* Copy & Paste worksheets #1, 3 and 4 from the original workbook into the
new one.

If anyone can help it would be a huge help.

Thanks!!
Dave
 
R

Ron de Bruin

Hi Dave

This will create a new workbook with the three sheets

ActiveWorkbook.Sheets(Array("Sheet1", "Sheet3", "Sheet4")).Copy
 
G

Guest

Thanks Ron.

Would you be able to put this into a workbook with a button etc.

I'm very new to Excel you see.

Thanks!
Dave
 
R

Ron de Bruin

I'm very new to Excel you see.

Workbook with the sheets you want to copy active

Alt F11
Insert module
paste the sub

Sub Copy_Sheets()
ThisWorkbook.Sheets(Array("Sheet1", "Sheet3", "Sheet4")).Copy
End Sub

Alt q to go back to Excel

Alt F8
Select "Copy_Sheets"
Run

Or insert a button from the forms or controltoolbox on another sheet
Example Forms button

Right click on a toolbar
Choose Forms
drag a button on your worksheet
And assign the macro "Copy_Sheets"
 
G

Guest

Thats brilliant Ron

Thanks a million!!!

Ron de Bruin said:
Workbook with the sheets you want to copy active

Alt F11
Insert module
paste the sub

Sub Copy_Sheets()
ThisWorkbook.Sheets(Array("Sheet1", "Sheet3", "Sheet4")).Copy
End Sub

Alt q to go back to Excel

Alt F8
Select "Copy_Sheets"
Run

Or insert a button from the forms or controltoolbox on another sheet
Example Forms button

Right click on a toolbar
Choose Forms
drag a button on your worksheet
And assign the macro "Copy_Sheets"
 

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