MsgBox popping up on delete

  • I am using this code below. It works great with one little flaw. Whenever I delete something from a cell it gives me the MsgBox "This mold can not run in this machine." I have included a blank cell in my "Data" range but am still getting the message. Any ideas on why and or how to stop it?



    I have attached a file below with a WARNING: you will get locked into a loop of MsgBox's when you delete an item or enter in one that does not exist in the table. You will have to hold down a while on the Esc key to end it. (bit annoying)

  • Re: MsgBox popping up on delete


    Putting

    Code
    Application.DisplayAlerts = False

    at the start of the routine will do the trick. Just remember to turn it back on at the end of the routine.

  • Re: MsgBox popping up on delete


    Brians12,
    It seems to me that the code is searching for a null/empty value after you delete a cell.
    The result of the find will then be the reult of looking for 'nothing' in wSht.Range("Data").


    Try changing If vResult <> "Y" Then... to
    If vResult <> "Y" and vResult is not nothing Then ...


    Untested, so I hope it helps

    Kieran

  • Re: MsgBox popping up on delete


    Nope. I inserted the statement right before my first If statement and turned it back on at the end of my If statement and I am still getting the message. The message is obviously coming from with in my If statements since it is a custom message.

  • Re: MsgBox popping up on delete


    Kieran,
    That did it. Actually I had to change it to:


    Code
    If vResult <> "Y" And vResult = "" Then


    The "Is Nothing" bombed out. But thank you very much for pointing me in the right direction.

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!