EnableEvents=False doesn't work? or does it?

I

Intellihome

Hello again,

I still need a fix for EnableEvents method, right now I am using globa
variable to work around this problem, but it really slows the program.

Here is the code

Private Sub Worksheet_Deactivate()
If CStr(Sheets("Display").Range("A38").Value) = "Y" Then

Sheets("Display").Range("A38").Value = vbNullString
Application.CalculateFull
Application.ScreenUpdating = False
Application.EnableEvents = False '<<<< this is where it i
turned off
Application.Calculation = xlCalculationManual

If CStr(Sheets("Data Input").Range("C3").Value) <> vbNullStrin
Then


With Sheets("Calculations")
.Range("B1").Value = 0
.Range("B153").Value = 1
.Range("B157").Value = 1
.Range("B158").Value = 1
End With

With Sheets("CustomCalculations")
.Range("B1").Value = 0
.Range("B153").Value = 1
End With

With Sheets("Display")
.Range("C4:IV41").ClearContents
.Range("A41:B297").ClearContents
.Range("B39").Value = "Y"


j = 1

.Application.Calculate '<<< this line triggers all events
and all event handling procedures in the workbook are being execute
here
....

the rest, I think, is not needed

Could some one tell me what the problem with it?
Any ideas are appreciated!
Thank you,
Iva
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top