create copy of workbook and clear some data in created workbook

Important Notice


Please note that on 14th December 2023 users will experience an expected outage whilst we make upgrades to our network. We anticipate this process may take a couple of hours and so we apologise in advance for any inconvenience.

  • I need a macro on button click that will create copy of active workbook, clear some cells in first 3 sheets of this copy file and save it. Before saving it also removes filtermode on sheet "sul".


    I wrote this code. It creates copy of workbook but doesn't clears cells at all and doesn't removes filtermode in copy file. After code execution copy file is open and source file is closed.
    Please help to correct it. Thanks.


  • Re: create copy of workbook and clear some data in created workbook


    Try this

  • Re: create copy of workbook and clear some data in created workbook


    royUK


    Thank you for your reply.



    I've already corrected it by changing SavAs on SaveCopyAs and it works.



    But your code is smarter.



    If I knew that in this case new workbook was an Activeworkbook I'd also use With ActiveWorkbook instead of this long rows of code.


    Thank you again. I study much using your examples. :)

Participate now!

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