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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With