Well one thing is for sure you cannot use a for loop, simply because you cannot get out of it until it finishes. You will have to replace it with a while loop.then place your code inside the while loop.
Hope this helps If you need more info just let me know or be more specific as to what you actually need.
Like Joe said, you can not exit a for loop before it finishes it's iterations without using the Abort button. If you want this functionality, I would recommend using a while loop with a stop condition that checks both the iteration number and a stop button control. Look at the attached picture for reference.