Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default Disable Worksheet change event

I have a worksheet change event (located in ThisWorkbook) that I need
to temporarily disable while another macro runs. How do I do this?

Thanks for the help.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 124
Default Disable Worksheet change event

Application.EnableEvents = False will disable ALL events. If you don't want to do that, then you
can use a public variable (in a standard module)

In the standard module:
Public Flag As Boolean

Sub AnotherMacro()
Flag = True
'run your code here
Flag = False
End Sub

In ThisWorkbook module:

Sub Worksheet_Change(.....)
If Flag Then Exit Sub
'the "real" code here
End Sub

Check out the Public statement in Help for more information about variable scope.



On 14 Jul 2003 10:12:27 -0700, (Tim) wrote:

I have a worksheet change event (located in ThisWorkbook) that I need
to temporarily disable while another macro runs. How do I do this?

Thanks for the help.


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 Tony S.[_2_] Excel Discussion (Misc queries) 11 February 18th 09 01:04 AM
Worksheet change Event ranswert Excel Worksheet Functions 1 January 17th 08 11:17 PM
Worksheet Change event LAF Excel Discussion (Misc queries) 3 January 4th 06 02:08 AM
Worksheet Change Event TonyM Excel Discussion (Misc queries) 8 March 11th 05 12:52 PM
Worksheet Row Change event crazybass2 Excel Discussion (Misc queries) 4 December 8th 04 05:29 PM


All times are GMT +1. The time now is 02:44 PM.

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"