Consulting

Results 1 to 4 of 4

Thread: Stop WorksheetChange Event

  1. #1

    Stop WorksheetChange Event

    Howdy,

    I have a macro that copies a bunch of data into a sheet. It will be used over and over. I also have a worksheetchange event to handle sorting after the data is copied in. However, I wrote the worksheetchange event with a static data set. Now, when I run the macro, the worksheetchange event fires in the middle and screws up the macro. Can I turn the event off until the macro is done??


  2. #2
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    Post the code.

  3. #3
    Administrator
    Chat VP
    VBAX Guru johnske's Avatar
    Joined
    Jul 2004
    Location
    Townsville, Australia
    Posts
    2,872
    Location
    Put Application.EnableEvents = False at the start of your macro code and Application.EnableEvents = True at the end of it (make sure you have error-handling in your macro so that events are re-enabled if an error occurs in it)
    You know you're really in trouble when the light at the end of the tunnel turns out to be the headlight of a train hurtling towards you

    The major part of getting the right answer lies in asking the right question...


    Made your code more readable, use VBA tags (this automatically inserts [vba] at the start of your code, and [/vba ] at the end of your code) | Help those helping you by marking your thread solved when it is.

  4. #4
    Thanks Johnske. I knew it was something like that.

Posting Permissions

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