Hello again,
I still need a fix for EnableEvents method, right now I am using global
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 is
turned off
Application.Calculation = xlCalculationManual
If CStr(Sheets("Data Input").Range("C3").Value) <> vbNullString
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 executed
here
....
the rest, I think, is not needed
Could some one tell me what the problem with it?
Any ideas are appreciated!
Thank you,
Ivan
--
Intellihome
------------------------------------------------------------------------
Intellihome's Profile: http://www.msusenet.com/member.php?userid=1479
View this thread: http://www.msusenet.com/t-1870564431
Bookmarks