-
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??
-
-
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.
-
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
-
Forum Rules