+ Reply to Thread
Results 1 to 4 of 4

Save only certain pages in workbook template

  1. #1
    Forum Contributor
    Join Date
    03-05-2009
    Location
    usa
    MS-Off Ver
    Excel 2016 32Bit
    Posts
    1,173

    Save only certain pages in workbook template

    If possible I would only like to save certain sheets from Master Workbook,if possible then the
    saved works would be more streamlined and smaller in size.

    Thanks Z
    Attached Files Attached Files

  2. #2
    Forum Contributor
    Join Date
    05-27-2014
    Location
    Belfast, Northern Ireland
    MS-Off Ver
    2007 & 2010
    Posts
    273

    Re: Save only certain pages in workbook template

    To do this with VBA, you'd need to come up with some kind of criteria to determine which sheets get saved and which don't. Maybe even a user form that lets the user tick which sheets to save. Once you figure that out, it's just a case of copying each sheet that matches the criteria to a new workbook and saving the workbook. It can all be done with very little VBA code.
    Please click *Add Reputation if I've helped

  3. #3
    Forum Contributor
    Join Date
    03-05-2009
    Location
    usa
    MS-Off Ver
    Excel 2016 32Bit
    Posts
    1,173

    Re: Save only certain pages in workbook template

    Lets say I'm working on worksheet trucks,and when I save as new name it will only save worksheets trucks,products,price sheet. If working on sheet cars then only save cars,products,price sheet.Worksheet tractors would be the same. In the sample file I set up userform on each sheet.

  4. #4
    Forum Contributor
    Join Date
    05-27-2014
    Location
    Belfast, Northern Ireland
    MS-Off Ver
    2007 & 2010
    Posts
    273

    Re: Save only certain pages in workbook template

    Ok, well with the sample you sent I'd go down this route:
    • First instead of having a button that starts a userform that starts a macro, I'd cut the userform out all together and just have the button on the sheet calling the macro direct.
    • Then since the user is pressing the button on the sheet they want to save, it's just a case of getting the name of the activesheet and saving copies of that along with the other two into a new workbook.
    • Since the macro would reside in a module on the master workbook no code is transferred over to the new workbook. So the button on the page that started the macro needs to be removed from the copy page in the new workbook as it is useless there.
    • The blank sheet ("Sheet1") that was created when the new workbook was created is also not needed.
    • Then just start the save as dialog.
    Please Login or Register  to view this content.
    Then all you need to do is change the caption of each button to something like "Save this data..." and instead of starting a userform in the click event of the button you would just call the macro like this (in the sheet module of the sheet the button is located on):
    Please Login or Register  to view this content.
    Last edited by kadeo; 09-04-2015 at 07:32 AM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Macro to open a Template and save a new workbook
    By Keibri in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 06-11-2015, 02:59 PM
  2. Save the template selected in ComboBox as new workbook
    By Alexb77 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-11-2014, 01:48 PM
  3. Template for query that can span multiple pages or sheets of a template if needed
    By anthallen_dps in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-17-2013, 11:52 AM
  4. create and save new workbook from template, using cell data and VBA
    By jimoneill64 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-15-2013, 05:30 AM
  5. VBA to choose template, fill it in and then save workbook - impossible??????
    By dm@stams in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 03-04-2012, 06:37 PM
  6. Replies: 2
    Last Post: 12-30-2005, 12:45 PM
  7. [SOLVED] How do you only save 4 pages of the workbook
    By Cathy in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 02-01-2005, 04:08 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1