Yard
Well-known Member
- Joined
- Nov 5, 2008
- Messages
- 1,929
Hi,
Am using a number of checks on Worksheet_Change and Worksheet_Calculate events and, depending on the result of the change, resetting a cell value.
For each of these I am using
Application.EnableEvents = False
Range("A1").Value = 0
Application.EnableEvents = True
to avoid that the change of A1's value triggers a calculation event and gets me into a loop.
However, something in my project is setting EnableEvents to False and not resetting it. I've searched the entire project for all instances and each "=False" is swiftly followed by a "=True". The code is not causing an error
The only way to get around this is to have a user press a button to re-enable events, but I can't tell them to press the button because there are no events to trigger the message!?!
Is there something I need to know about this technique?
Am using a number of checks on Worksheet_Change and Worksheet_Calculate events and, depending on the result of the change, resetting a cell value.
For each of these I am using
Application.EnableEvents = False
Range("A1").Value = 0
Application.EnableEvents = True
to avoid that the change of A1's value triggers a calculation event and gets me into a loop.
However, something in my project is setting EnableEvents to False and not resetting it. I've searched the entire project for all instances and each "=False" is swiftly followed by a "=True". The code is not causing an error
The only way to get around this is to have a user press a button to re-enable events, but I can't tell them to press the button because there are no events to trigger the message!?!
Is there something I need to know about this technique?