Excel macros do not seem to allow the use of "undo" after running them. Is there any way to bake undo
functionality into a VBA macro in Excel?
Excel VBA has the Application.OnUndo
function to handle this:
Public Sub DoSomething
... do stuff here
Application.OnUndo "Undo something", "UnDoSomething"
End Sub
Public Sub UnDoSomething
... reverse the action here
End Sub