Results 1 to 3 of 3
  1. #1
    4 Star Lounger
    Join Date
    Jan 2001
    Location
    Michigan, USA
    Posts
    408
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Endless Loop (Excel 97 SR2)

    Hi Everyone,
    Is there a way to stop an endless loop in a macro? I should know this but I don't. <img src=/S/stupidme.gif border=0 alt=stupidme width=30 height=30>

    When I execute the macro attached, if there is only one row that has data, Excel just hangs. I'm thinking it is looping but I don't know how to stop it or why it didn't recognize the one row of data then stop. I can't seem to make the file small enough to attach but I am attaching the macro itself. I hope that is enough information.

    TIA
    <font face="Comic Sans MS"><big><font color=4682b4>Sherry</font color=4682b4></big></font face=comic>

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Endless Loop (Excel 97 SR2)

    Ctrl+Break will get you out of an endless loop. It will take you to the Visual Basic Editor with the code paused on the instruction that was being executed; click the "Stop" button or select Run | Reset to end macro execution.

  3. #3
    2 Star Lounger
    Join Date
    Jul 2002
    Location
    Paragould, Arkansas, USA
    Posts
    194
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Endless Loop (Excel 97 SR2)

    Sherry,
    If you could delete all the non-essential information on your spreadsheet (so it's smaller), then re-post it, that might help. I "backwards engineered two worksheets in a workbook to fit your macro. I ran it with what I thought was three lines of data, and with one line of data. Both seem to work.

    A general hint: 'comment out the
    <font face="Georgia">Application.ScreenUpdating = False</font face=georgia>
    line, then step through the macro. Or even just start it, and watch where the loop or whatever seems to be.

    Errol

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •