After the execution of a macro in Excel, there's no button to revoke it, unless you close the book and choose not to save it.
Is there a neat and easy way to just revoke it?
The short answer is you can't Undo (I assume this is what you mean by revoke) the actions of a macro. The decisions that take place inside the programming language could be troublesome for Excel to reverse, so there is a blanket "Can't Undo" state induced by kicking off the macro.
The long answer is that if you anticipate Undo being required, your code should accommodate that request by storing the previous state of the data before execution. This is a very broad assumption that you are working with data in VBA; direct file creation and manipulation could be trickier depending on what's executed.
John Walkenbach gives a good example of storing data to provide a future Undo facility:
I think his opening statement is a little misleading though: for non-coding users the answer is "no, you can't undo a macro".
|show 9 more comments|