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
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
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
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.
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.
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.
Please Login or Register to view this content.
Last edited by kadeo; 09-04-2015 at 07:32 AM.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks