How can I restart the makro execution in Excel?

Jan HALLER 0 Reputation points
2023-05-04T08:33:01.1866667+00:00

How can I restart the makro execution in Excel if it was stopped due to an error in the makro execution (with displaying options like debug or break)? The only way I have found so far is to completely close Excel and restart it.

Microsoft 365 and Office | Development | Other
Microsoft 365 and Office | Excel | For business | Windows
{count} votes

2 answers

Sort by: Most helpful
  1. Viorel 122.6K Reputation points
    2023-05-04T11:44:43.92+00:00

    Try to press the button from the error dialog (i.e. go to Visual Basic window), then select Reset from Run menu.

    Then fix the macro and re-execute it.


  2. Tanay Prasad 2,250 Reputation points
    2023-05-05T04:35:45.1733333+00:00

    Hi,

    You can restart the macro execution in Excel by following these steps:

    Press ALT + F11 to open the Visual Basic Editor.

    In the Visual Basic Editor, navigate to the module that contains the macro that you want to run.

    Place your cursor in the macro code where you want to restart the execution.

    Press F5 or select Run from the menu bar and click Run Sub/UserForm.

    When the error message appears, click on the "Debug" button.

    In the Visual Basic Editor, you can now make changes to the code to fix the error.

    Once you have fixed the error, you can run the macro again by pressing F5 or selecting Run from the menu bar and clicking Run Sub/UserForm.

    If you want to stop the macro execution entirely, you can press the "End" button or use the shortcut key "Ctrl + Break".

    Best Regarrds.

    0 comments No comments

Your answer

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