after the condition is finished, the code does not stop, and then it works. I need the code to stop working when the condition ends (I'm Russian, it's hard for me to explain in English)you mean cancel macro actions or the action that is at the end of the macro (there's no action at the end) ?