April 9, 2024
Contribute to the Microsoft 365 and Office forum!
Click here to learn more 💡
May 10, 2024
Excel Forum Top Contributors:
how to undo after creating a macro in Excel
Thank you!
Report abuse
Thank you.
Reported content has been submitted
Clearing the undo stack is an unfortunate side effect of running VBA code. You can't prevent it, but there are rather cumbersome ways to provide undo capability - see http://www.jkp-ads.com/Articles/UndoWithVBA00.asp
Best wishes, HansV
https://www.eileenslounge.com
Report abuse
Thank you.
Reported content has been submitted
4 people found this reply helpful
·Was this reply helpful?
Sorry this didn't help.
Great! Thanks for your feedback.
How satisfied are you with this reply?
Thanks for your feedback, it helps us improve the site.
How satisfied are you with this reply?
Thanks for your feedback.
You cannot Undo changes that are made with code.
When testing code you should frequently save the Workbook with version numbers. Ensure you save before running the code and then if necessary you can close the workbook without saving and re-open the saved version.
Added with Edit: Also I always try to code so that existing (or source data) is not changed. This is done by having Source data on one worksheet and Output data on another worksheet. This may not always be practical but wherever possible it should be done this way.
OssieMac
Report abuse
Thank you.
Reported content has been submitted
4 people found this reply helpful
·Was this reply helpful?
Sorry this didn't help.
Great! Thanks for your feedback.
How satisfied are you with this reply?
Thanks for your feedback, it helps us improve the site.
How satisfied are you with this reply?
Thanks for your feedback.
Question Info
Last updated March 10, 2024 Views 17,539 Applies to: