Successful Step Ends Macro?

Hello Keyboard Maestros:

Is there a "step" I could put into a macro that will stop the macro if a step is successful?

My example, in Excel, depending on the selected area, the Edit > Delete function is either "Delete…" or "Delete". I would like KM to stop if the first option ("Delete…") is successful so as to not perform an "extra" delete.

Thank you!


Yes. To be clear, KM uses "Actions" for what you have called a "step".

You can use a If Then Else action with a Action Result condition to test the success ("OK") of the last Action that was executed.

Just put this Action AFTER your Action that performs the Excel operation:


Thank you, JMichaelTX, for not only the clarification, but a solution.

As with most KM solutions, twas right in front of me. I appreciate more skilled users in the KM tribe stepping up to the plate to help.



1 Like

You can have alternatives in the Select or Show a Menu Item action, so you can use:


Even “better” (perhaps), thank you, though I appreciate all the opportunities to use KM more wisely.