Automatically Delete Certain Sheets Upon Save As

  • Our company has designed a Excel Document for quoting purposes. The problem we are having is that certain sheets that are needed to do the quote do not need to be used after the quote is finished and saved. These extra worksheets are taking up a lot of room on our server.


    In the document I have already disabled the save feature so that the saveas has to be used. Is there code that can delete sheets 3, 5, 6, 7, 8 upon doing a save as?


    Thanks

  • Re: Automatically Delete Certain Sheets Upon Saveas


    In the workbook module:


    ADDED BY ADMIN;


    If ONLY on Save As, you need an IF Statement;

  • Re: Automatically Delete Certain Sheets Upon Saveas


    This worked perfect. The only thing I had to change was the tab reference. The tabs actually have different names other than 1, 2, 3... so I reference just the sheets(1), sheets(2)... I also added two lines to make it go back to the first tab instead of the last which was getting really annoying. The code is below.


    Again, you guys are great


    Thanks for your help.


  • Re: Automatically Delete Certain Sheets Upon Saveas


    If ONLY on Save As, you need an IF Statement;

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!