Forum Discussion

1 Reply

  • NikolinoDE's avatar
    NikolinoDE
    Platinum Contributor

    Vimal_Gaur 

    Does the question refer to deleting a sheet, or to the sheet contents?

    In general, macro actions cannot be undone.

    You can also see this from the fact that after making changes to a sheet using a macro,

    the "Undo" command or button is not active.

    The VBA function "Undo" only undoes the last user input before running the macro.

    But deleting the sheet cannot be undone.

    When Worksheet_Change macros are running, the undo history is cleared. There's no avoiding that. You could undo the last input, like this with this example:

     

     

    Sub NUndo()
    Application.Undo
    End Sub

     

     

     *but as I said...it depends on a lot.

    As an additional tip for the future:
    to be on the safe side, you can have a backup copy created in "File -> Options -> Save".
    Then you always have a version before the last save.
     
     

    Hope I was able to help you with this info.

     

    NikolinoDE

    I know I don't know anything (Socrates)

     
     

     

Resources