How to stop a never ending loop

Hi,

Is there a command to stop a executed function. It happends that I sometimes created loops that countious for ever. I have so far had to quit excel to make it stop. But I guess there some command to stop this process.

Anyone that knows this

Thanks in advance.

\Jonas




Answer this question

How to stop a never ending loop

  • Tom Nash

    I think Ctrl-Break does what your looking for... if not try Shift-Break or Alt-Break or Punch-Kick-Break

  • Nishant Sivakumar

    Thanks for your replay. But it wasn't the problem. I meant if I execute a macro and it's, off course by mistake a never ending loop in that macro how can a stop that macro At the moment I'm using Ctrl+Alt+Delete to end Excel but I'm sure that it has to be a way to just stop the macro. In matlab for instance I think it's Ctrl+c. \Jonas

  • Douglas911

    Thanks Derek,

    Ctrl + Break did it.

    Kind regards

    \Jonas



  • Bluehunter

    Hi Jonas

    You need to look at the EXIT command so that you can jump out of the loop if certain conditions are met. It would probably be better to re-engineer your code so that you do not get stuck in the loop, if possible.


  • How to stop a never ending loop