+ Reply to Thread
Results 1 to 8 of 8

Worksheet_Change (ByVal Target As Range)

  1. #1
    Registered User
    Join Date
    07-20-2018
    Location
    Hong Kong
    MS-Off Ver
    2007
    Posts
    60

    Post Worksheet_Change (ByVal Target As Range)

    Dears,

    I used the following code the check if more than one cell is changed at once.

    Please Login or Register  to view this content.
    Due to the work relationship, I need to copy a series of cell data and paste it, then VBA stops. I need to close the workbook and open it again to get back to normal.
    What code can I use to solve or run in parallel?

  2. #2
    Forum Expert Greg M's Avatar
    Join Date
    08-16-2007
    Location
    Dublin. Ireland
    MS-Off Ver
    Office 2016
    Posts
    4,481

    Re: Worksheet_Change (ByVal Target As Range)

    Hi there,

    Without seeing your entire code it is impossible to determine what the problem is.

    Your test causes a very "abrupt" termination of the routine, and I suspect that something (e.g. Application.EnableEvents) needs to be reset before exiting from the routine. Can you provide further information?

    Regards,

    Greg M

  3. #3
    Registered User
    Join Date
    07-20-2018
    Location
    Hong Kong
    MS-Off Ver
    2007
    Posts
    60

    Re: Worksheet_Change (ByVal Target As Range)

    Dear Greg M,

    Below is the code.

    Please Login or Register  to view this content.
    Regards,

    Oliver

  4. #4
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,078

    Re: Worksheet_Change (ByVal Target As Range)

    How about
    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    07-20-2018
    Location
    Hong Kong
    MS-Off Ver
    2007
    Posts
    60

    Re: Worksheet_Change (ByVal Target As Range)

    Dear Fluff13,

    It works.
    Besides, the code is used for one cell change. How about if more than one cell change at the same time (copy & paste)?

    Regards,

    Oliver

  6. #6
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,078

    Re: Worksheet_Change (ByVal Target As Range)

    How about
    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    07-20-2018
    Location
    Hong Kong
    MS-Off Ver
    2007
    Posts
    60

    Re: Worksheet_Change (ByVal Target As Range)

    Dear Fluff13,

    Perfect!
    This is the great answer.

    Regards,
    Oliver

  8. #8
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,078

    Re: Worksheet_Change (ByVal Target As Range)

    You're welcome & thanks for the feedback.

+ 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. [SOLVED] Worksheet_Change(ByVal Target As Range)
    By zubinnajmi in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 07-24-2019, 08:50 AM
  2. HELP with Worksheet_Change(ByVal Target As Range)
    By jadown in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-16-2018, 05:06 PM
  3. [SOLVED] Worksheet_Change (ByVal target As Range)
    By art_a_game in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-12-2016, 11:21 PM
  4. Replies: 5
    Last Post: 12-16-2014, 05:47 PM
  5. [SOLVED] Worksheet_Change(ByVal Target As Range) - set to only update when 3 target cells changed?
    By trillium in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-07-2012, 06:40 PM
  6. Worksheet_CHange (ByVal Target as Range) when target is formula cell
    By coasterman in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-09-2012, 07:00 PM
  7. use of Worksheet_Change(ByVal Target As Range)
    By Isaac in forum Excel General
    Replies: 2
    Last Post: 07-07-2006, 02:10 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