Export Several Worksheet Groups (Values Only) Macro

L

Louise

Hi All,

I need some help please...

I have a workbook (which due to many pivots and formulae is massive), I need
a macro to export groups of sheets to new workbooks (each time it is run)
then return to the workbook and export another group for example:

I need Belgium & Netherlands to be exported (values only) to one workbook,
then from the original workbook I need Spain & Switzerland exported to
another fresh workbook, so in the end I have 3 files, one original, one with
Bel & Neth, and the other with Spa & Swi. I also need the data to be exported
as values only.

Currently I have the code below but it errors on workbook("Test").Select

Sheets(Array("Netherland", "Belgium")).Select
ActiveWindow.SelectedSheets.Copy

Workbook("Test").Select

Any help much appreciated
 
J

Jacob Skaria

I didnt get what workbook "Test" is? If you want to select or save the new
workbook try the below....

Dim wb As Workbook
Sheets(Array("Netherland", "Belgium")).Copy
Set wb = ActiveWorkbook
wb.SaveAs "c:\test.xls"
 
L

Louise

Hi Jacob - Thank you for responding, "Test" is my original workbook, I
presume after 'exporting' the 2 sheets Netherlands and Belgium, my macro
would then have to reselect / make active the main/original workbook to then
export the next 2 grouped sheets Spain & Switzerland?

Thanks for your help!
 

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