ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Create New Workbook from Worksheets in One Workbook (https://www.excelbanter.com/excel-discussion-misc-queries/146799-create-new-workbook-worksheets-one-workbook.html)

Dave

Create New Workbook from Worksheets in One Workbook
 
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

Ron de Bruin

Create New Workbook from Worksheets in One Workbook
 
Hi Dave

This will create a new workbook with the three sheets

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


--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Dave" wrote in message ...
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


Dave

Create New Workbook from Worksheets in One Workbook
 
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

"Ron de Bruin" wrote:

Hi Dave

This will create a new workbook with the three sheets

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


--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Dave" wrote in message ...
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



Ron de Bruin

Create New Workbook from Worksheets in One Workbook
 
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"




--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Dave" wrote in message ...
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

"Ron de Bruin" wrote:

Hi Dave

This will create a new workbook with the three sheets

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


--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Dave" wrote in message ...
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



Dave

Create New Workbook from Worksheets in One Workbook
 
Thats brilliant Ron

Thanks a million!!!

"Ron de Bruin" wrote:

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"




--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Dave" wrote in message ...
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

"Ron de Bruin" wrote:

Hi Dave

This will create a new workbook with the three sheets

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


--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Dave" wrote in message ...
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




All times are GMT +1. The time now is 03:37 AM.

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