Excel undo not working

Kareem Culbertson 115 Reputation points
2026-07-09T17:44:27.4133333+00:00

Hi,

The excel undo button is not working with Macros. This issue only occurs on one specific document downloaded from OneDrive. It is shared with other users and they experience the same issue. This does not occur with other excel files. Is there a way to troubleshoot or a fix for this?

Thanks in advance for any assistance.

Best,

Kareem

Microsoft 365 and Office | Excel | For business | Windows

1 answer

Sort by: Most helpful
  1. Hendrix-C 19,450 Reputation points Microsoft External Staff Moderator
    2026-07-09T18:34:23.7033333+00:00

    Hi Kareem,

    Based on your sharing, if the issue happens only in one macro-enabled workbook and every user sees the same behavior, that likely means that there is a workbook VBA/event macros that disables the normal Undo command.

    In this case, you need to check the code inside that workbook by pressing Alt + F11 to open the VBA editor > check This Workbook, each worksheet modules and also standard modules. If you see any script starting with either of those:

    • Private Sub Worksheet_Change(ByVal Target As Range)
    • Private Sub Worksheet_SelectionChange(ByVal Target As Range)
    • Private Sub Workbook_Open
    • Private Sub Workbook_Calculate

    Those macros will take actions such as format cells, copies formulas, etc. whenever a user changes or select a cell, open the worksheet or recalculate any cell. More important, the actions caused by those macros cannot be rolled back by using Undo.

    In case you want to disable the macros, you can:

    1/ Use macro settings:

    • Go to File > Options > Trust Center > Trust Center Settings > Macros Settings > choose either:
      • Disable VBA macros with notification: stop macros from running while still showing a banner saying that the file is containing macros with and "Enable Macros" option so you can run it if you want
      • Disable VBA macros without notification: macros will be completely disabled in the background without any banner/option.
    • Then close the workbook and reopen it again

    User's image

    2/ Save a macro-free copy

    • Open the file and go to File > Save As > save as Excel Workbook (.xlsx) instead of Excel Macro-Enabled Workbook (.xlsm)
    • If prompted with a warning, select Save/OK
    • This will delete macros in the saved xlsx copy but not from the original file. You can use this for testing or if you no longer need macros

    You can try checking and let me know whether it works. If not, please feel free to reach out again in the comments on this post. I'm happy to assist you further

    Thank you for your understanding and cooperation. I'm looking forward to your reply.


    If the answer is helpful, please click "Yes" and kindly upvote it.

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    Was this answer helpful?


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.