+ Reply to Thread
Results 1 to 2 of 2

save a backup file before macro run to undo it

  1. #1
    Forum Contributor
    Join Date
    03-12-2018
    Location
    London, England
    MS-Off Ver
    2016
    Posts
    118

    save a backup file before macro run to undo it

    Hello everyone, I would like to ask your help.

    I have a file with loads of data on different sheets, thousands of formulas and a macro that runs and calculate sheets multiple times.

    This means that after a macro run (and there is a loop in it, so we are talking about dozens of calculations) the file is quite impossible to put back as it was before running the macro. Too many things to keep in consideration.

    What I need is an "UNDO" function that puts the things as they were before the macro ran. As I said, it's not one cell but thousands of data so what I thought is that possibly the easiest way is that the first thing that the macro does is saves the file with a different name, closes it, goes back to original file and carries on with the script.
    Then another macro that I can call "UNDO" and that I can action with a button opens the back up file and closes the other one. So it's like I've undone the latest macro run.

    Anybody that can help me creating the code for this? Thank you so much in advance

  2. #2
    Valued Forum Contributor
    Join Date
    02-06-2014
    Location
    N/A
    MS-Off Ver
    N/A
    Posts
    373

    Re: save a backup file before macro run to undo it

    Workbook.SaveCopyAs may be your friend here

    https://docs.microsoft.com/en-us/off...ook.savecopyas

+ 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. Save as without creating a backup file
    By chengafni in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-01-2015, 12:11 PM
  2. Save Backup File to Different Location On Save and Exit
    By slindfors in forum Excel General
    Replies: 0
    Last Post: 06-16-2015, 09:01 AM
  3. [SOLVED] Automatic save as backup when opening file
    By Christopherdj in forum Excel Programming / VBA / Macros
    Replies: 25
    Last Post: 01-29-2015, 08:36 PM
  4. Macro to Auto save a backup copy in a seperate location OR save file with a pop up
    By kdsanderson30 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 06-12-2014, 12:38 PM
  5. Creating macro to save a backup copy of the same file in a shared drive
    By Kiran9 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 09-29-2011, 07:15 AM
  6. Creating Backup file! (Not Save-as)
    By Rick_Stanich in forum Excel General
    Replies: 1
    Last Post: 11-24-2009, 06:34 PM
  7. [SOLVED] Backup:always create a backup file in the save options
    By Alek in forum Excel General
    Replies: 1
    Last Post: 01-07-2006, 09:25 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