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?
undo
Excel VBA has the Application.OnUndo function to handle this:
Application.OnUndo
Public Sub DoSomething ... do stuff here Application.OnUndo "Undo something", "UnDoSomething" End Sub Public Sub UnDoSomething ... reverse the action here End Sub