Actions by macros usually cannot be undone with undo. Closing the file without saving may solve the problem. If you have the file stored in a cloud service, you might be able to recover a previous version. When working with macros it is important to always set backup copies aside. I hope this answers your question.