+ Reply to Thread
Results 1 to 6 of 6

disable Private Sub Worksheet_Change(ByVal Target As Range)

  1. #1
    Valued Forum Contributor
    Join Date
    11-20-2003
    MS-Off Ver
    2010, 2016
    Posts
    1,176

    disable Private Sub Worksheet_Change(ByVal Target As Range)

    I have a macro that is creating formulas in a spreadsheet. The only issue I have (and I think it is slowing down the code) is that everytime I create a formula in each cell the code calls the "Private Sub Worksheet_Change(ByVal Target As Range)" code each time. Is there a way to disable temporarily and then enable once the macro is complete? Thanks.
    Last edited by maacmaac; 01-06-2011 at 04:37 PM.

  2. #2
    Forum Guru
    Join Date
    08-26-2007
    Location
    London
    Posts
    4,606

    Re: disable Private Sub Worksheet_Change(ByVal Target As Range)

    Do you really need to apply change event to every cell?

    If so, add
    Please Login or Register  to view this content.
    at the start, and turn back on at the end.

  3. #3
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: disable Private Sub Worksheet_Change(ByVal Target As Range)

    Please Login or Register  to view this content.
    Entia non sunt multiplicanda sine necessitate

  4. #4
    Valued Forum Contributor
    Join Date
    11-20-2003
    MS-Off Ver
    2010, 2016
    Posts
    1,176

    Re: disable Private Sub Worksheet_Change(ByVal Target As Range)

    Thanks for comment. I only need the change event for one single cell. Do I have the code written correctly?
    Please Login or Register  to view this content.

  5. #5
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: disable Private Sub Worksheet_Change(ByVal Target As Range)

    Try this:
    Please Login or Register  to view this content.

  6. #6
    Valued Forum Contributor
    Join Date
    11-20-2003
    MS-Off Ver
    2010, 2016
    Posts
    1,176

    Re: disable Private Sub Worksheet_Change(ByVal Target As Range)

    That works fine. Thanks

+ 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