Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default How to disable tempory an automatic Worksheet_Change Event

Hoi,

I'm using a macro to copy data from file-1 to file-2.
In file-2 (which is not my file) an automatic ChangeEvent is build in
by another person on such a way that when I copy data to a specific
datafield I get an automatic popup with a question.
It's not allowed for me to change this code, but............ I don't
want that pop-up when I'm copying data into it. Is there a way I can
disable that code when I'm copying.

Something like:
'disable code for AutoEvent.....
'copy data
'enable code for AutoEvent....

below the code which I found in that file-2 as I mentioned.

Private Sub Worksheet_Change(ByVal Target As Range)
Dim ChangedRange As Range
Set ChangedRange = Range("I25:I33")
If Union(Target, ChangedRange).Address = ChangedRange.Address Then
CheckResult '=run another macro
End If
End Sub

regards,
Johan
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,355
Default How to disable tempory an automatic Worksheet_Change Event

Sure, use

Application.EnableEvents = FALSE

to disable event handling and

Application.EnableEvents = TRUE

to enable event handling.

--
HTH,
Barb Reinhardt

If this post was helpful to you, please click YES below.



" wrote:

Hoi,

I'm using a macro to copy data from file-1 to file-2.
In file-2 (which is not my file) an automatic ChangeEvent is build in
by another person on such a way that when I copy data to a specific
datafield I get an automatic popup with a question.
It's not allowed for me to change this code, but............ I don't
want that pop-up when I'm copying data into it. Is there a way I can
disable that code when I'm copying.

Something like:
'disable code for AutoEvent.....
'copy data
'enable code for AutoEvent....

below the code which I found in that file-2 as I mentioned.

Private Sub Worksheet_Change(ByVal Target As Range)
Dim ChangedRange As Range
Set ChangedRange = Range("I25:I33")
If Union(Target, ChangedRange).Address = ChangedRange.Address Then
CheckResult '=run another macro
End If
End Sub

regards,
Johan

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Worksheet_Change Event thewizz Excel Programming 4 November 2nd 07 02:15 PM
How do I change a Worksheet_change event to a beforesave event? Tueanker Excel Programming 5 June 29th 07 03:00 PM
Worksheet_change event Dwayne Smith Excel Programming 2 June 5th 04 03:25 AM
Worksheet_Change Event cmcfalls[_4_] Excel Programming 3 April 12th 04 09:47 PM
Worksheet_Change Event Sam Excel Programming 2 November 21st 03 06:51 PM


All times are GMT +1. The time now is 10:37 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"