+ Reply to Thread
Results 1 to 3 of 3

Delete row based on single column value

  1. #1
    Registered User
    Join Date
    11-17-2011
    Location
    KL, Malaysia
    MS-Off Ver
    Excel 2010
    Posts
    9

    Delete row based on single column value

    Hello,

    I notice there is another thread on this, not sure if i should combine it as it stated [solved].

    My script is running perfectly, but when i add this code in the script,

    Please Login or Register  to view this content.
    the script continues to run without stopping. When i choose to debug, it will highlight my End If.

    Could someone advise me what is wrong with my code?

    Thanks in advance.

    Cheers

  2. #2
    Forum Expert Paul's Avatar
    Join Date
    02-05-2007
    Location
    Wisconsin
    MS-Off Ver
    2016/365
    Posts
    6,887

    Re: Delete row based on single column value

    Hi Urchino, welcome to the forum.

    I'd recommend a small adjustment:
    Please Login or Register  to view this content.
    Also note that if this is part of a change event -- or if you have a Worksheet_Change event that does something else -- you should disable events within this macro so you are not triggering that event repeatedly. You can do so by adding this before the deletions:
    Please Login or Register  to view this content.
    One final note: If your macro crashes before re-enabling events, no other macros will work in Excel. You will need to re-enable macros by running that last line of code by itself (you can put it in a small Sub/EndSub).

    A better way would be to add error handling to your macro, so that if an error does occur it is trapped and you can re-enable events and other settings before the macro completely finishes running. For that, do some searching here (many examples) and Google.

  3. #3
    Registered User
    Join Date
    11-17-2011
    Location
    KL, Malaysia
    MS-Off Ver
    Excel 2010
    Posts
    9

    Re: Delete row based on single column value

    Thanks Paul.

    It still can't stop running after i amend. I split it out Sub End Sub and it works. After which i combine it again and it works with the code you provided. Thank you once again.

    Cheers

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1