Consulting

Results 1 to 2 of 2

Thread: Delete Row sends Excel into an infinite loop

  1. #1
    VBAX Regular
    Joined
    Mar 2009
    Location
    Stowmarket
    Posts
    62
    Location

    Delete Row sends Excel into an infinite loop

    I've written a small application for my nephew that checks if a Cell in a certain Range is amended, then the sheet is updated by taking all of the data in that Range & replicating it below, but sorted into Column D order.

    The attached is a very small example of this and I am happy with how it works ... HOWEVER ... if I delete a line, although the program seems to step through perfectly OK, Excel then goes into some kind of loop, it certainly isn't responding, I have to use Task Manager to end the Excel process !!!

    I can obviously look into the "Insert" option myself when I understand why this is happening, as "Insert" will need a small routine of its own anyway ...

    Can anybody help & explain what is going on and why ?!?!?
    Attached Files Attached Files

  2. #2
    VBAX Regular
    Joined
    Mar 2009
    Location
    Stowmarket
    Posts
    62
    Location
    OK , missed the blatantly obvious ... as soon as I delete a Row, then this becomes the first blank Row and therefore the Range is wrong ... quite what happens to cause the looping I'm not sure, but this is obviously a contributory factor !!!

    So ... as soon as the Delete key is pressed, the Event-Handler routine is triggered ... is there a way of trapping the fact that the Delete key has been pressed to delete an entire Row so that I can handle that manually ?

Posting Permissions

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