+ Reply to Thread
Results 1 to 10 of 10

Worksheet_change_event When i delete any entry form target row then macro stop work

  1. #1
    Forum Contributor HaroonSid's Avatar
    Join Date
    02-28-2014
    Location
    india
    MS-Off Ver
    Excel 2013
    Posts
    2,080

    Worksheet_change_event When i delete any entry form target row then macro stop work

    hi
    i am using below code to add some data and formulas copy paste as i type in column c

    but sometimes i type wrong and i delete the entry then code stops to work,
    no i close the workbook and open it again to work my worksheet change event

    thanx alot


    Please Login or Register  to view this content.
    Use Code-Tags for showing your code :
    Please mark your question Solved if there has been offered a solution that works fine for you
    If You like solutions provided by anyone, feel free to add reputation using STAR *

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Worksheet_change_event When i delete any entry form target row then macro stop work

    Where does the code stop working?
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  3. #3
    Forum Contributor HaroonSid's Avatar
    Join Date
    02-28-2014
    Location
    india
    MS-Off Ver
    Excel 2013
    Posts
    2,080

    Re: Worksheet_change_event When i delete any entry form target row then macro stop work

    than a lot for reply

    it it not showing an error, just stoped working
    if delete an entry from target row (range c) then it not copy the data
    if i delete multiple entries then its working ok

  4. #4
    Valued Forum Contributor bulina2k's Avatar
    Join Date
    11-20-2012
    Location
    Urziceni, Ialomita, Romania
    MS-Off Ver
    2019 and 365
    Posts
    861

    Re: Worksheet_change_event When i delete any entry form target row then macro stop work

    At the first sight from what I can notice you stop the events from triggering and if target = "" (like delete content does) you never put event on:

    Please Login or Register  to view this content.
    your code stops working because Application.EnableEvents remains False
    .. and don't forget to have fun!
    Bogdan.

    mark SOLVED and Add Reputation if my answer pleases you

  5. #5
    Forum Contributor HaroonSid's Avatar
    Join Date
    02-28-2014
    Location
    india
    MS-Off Ver
    Excel 2013
    Posts
    2,080

    Re: Worksheet_change_event When i delete any entry form target row then macro stop work

    HI, bulina2k

    thanx for reply

    yes u r right

    now tell what i do? or correct my code plz

  6. #6
    Forum Contributor HaroonSid's Avatar
    Join Date
    02-28-2014
    Location
    india
    MS-Off Ver
    Excel 2013
    Posts
    2,080

    Re: Worksheet_change_event When i delete any entry form target row then macro stop work

    or
    help me to combine above code correctly

    thanx

  7. #7
    Valued Forum Contributor bulina2k's Avatar
    Join Date
    11-20-2012
    Location
    Urziceni, Ialomita, Romania
    MS-Off Ver
    2019 and 365
    Posts
    861

    Re: Worksheet_change_event When i delete any entry form target row then macro stop work

    you should take the Application.EnableEvents = True out of the next if else :
    Please Login or Register  to view this content.

  8. #8
    Forum Contributor HaroonSid's Avatar
    Join Date
    02-28-2014
    Location
    india
    MS-Off Ver
    Excel 2013
    Posts
    2,080

    Re: Worksheet_change_event When i delete any entry form target row then macro stop work

    Thanx a lot
    bulina2k

    yes you r rignt, i correct the code as u mentioned above,

    plz check on again in all event if any mistake found plz correct this one too

  9. #9
    Forum Contributor HaroonSid's Avatar
    Join Date
    02-28-2014
    Location
    india
    MS-Off Ver
    Excel 2013
    Posts
    2,080

    Re: Worksheet_change_event When i delete any entry form target row then macro stop work

    Thanx a lot
    bulina2k

    yes you r rignt, i correct the code as u mentioned above,

    plz check on again in all event if any mistake found plz correct this one too

  10. #10
    Forum Contributor HaroonSid's Avatar
    Join Date
    02-28-2014
    Location
    india
    MS-Off Ver
    Excel 2013
    Posts
    2,080

    Re: Worksheet_change_event When i delete any entry form target row then macro stop work

    yes,
    its working perfectly

    thanx a ton to you mr. bulina2k

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. How do I stop a macro when delete is pressed on the target cell?
    By BallardBandit in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-14-2015, 12:20 AM
  2. Replies: 2
    Last Post: 06-07-2013, 09:08 AM
  3. [SOLVED] Change(ByVal Target As Range) does not work when Target value changes
    By LeonvL in forum Excel Programming / VBA / Macros
    Replies: 22
    Last Post: 01-07-2013, 06:59 PM
  4. Data entry form, how to update / delete / prevent duplicates?
    By SueJB in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-15-2012, 08:26 PM
  5. Tranferring Variable Entry from Form Entry to Macro
    By austindude in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-02-2009, 12:08 AM
  6. Replies: 1
    Last Post: 02-19-2007, 04:52 PM
  7. Target Address/Value Macro Won't Work
    By Paige in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-24-2006, 07:15 PM

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