Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 217
Default Export Several Worksheet Groups (Values Only) Macro

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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8,520
Default Export Several Worksheet Groups (Values Only) Macro

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"


--
Jacob (MVP - Excel)


"Louise" wrote:

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

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 217
Default Export Several Worksheet Groups (Values Only) Macro

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!

"Jacob Skaria" wrote:

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"


--
Jacob (MVP - Excel)


"Louise" wrote:

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

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Identifying the top five values in multiple groups RobFJ[_4_] Excel Worksheet Functions 7 April 27th 10 10:19 PM
Counting highest values within groups of four PaladinWhite Excel Worksheet Functions 3 May 29th 08 05:30 AM
unique values within groups [email protected] Excel Worksheet Functions 5 February 6th 07 01:24 PM
Macro to export a worksheet and save as new file Mike_M Excel Programming 2 May 25th 05 10:37 AM
Simple macro needed to export a worksheet RobG Excel Programming 9 April 11th 05 10:13 AM


All times are GMT +1. The time now is 06:52 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"