View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Gary''s Student Gary''s Student is offline
external usenet poster
 
Posts: 11,058
Default Code Takes Forever to Run - Why?

Application.EnableEvents=False
..Range("AutoTrigger_Impl_Fee") = 0
Application.EnableEvents=True
--
Gary''s Student - gsnu200812


"BJ" wrote:

I'm having difficulty with the following code. If I remove the first 'IF'
statement regarding the comparison to < 1500, it runs fine (ie, quickly), but
inserting it causes the routine to take about 1 minute to run ... forever in
my world ... and I can't figure out why it's causing such a delay.

I don't have to have the code built this way, but I've pulled it out into
it's ow separate section and the result - slow run time - persists.

Any help is greatly appreciated.

Brett

Private Sub Worksheet_Change(ByVal Target As Range)
With Me
If Intersect(Target, .Range("FROI_Vol"), .Range("SROI_Vol"),
.Range("MSR_Vol")) Is Nothing Then
If .Range("Total_Vol").Value < 1500 Then
.Range("AutoTrigger_Impl_Fee") = 0
Else
If .Range("Total_Vol").Value < 501 Or RenewProduct.Value = True Then
PT_Yes.Enabled = False
PT_No.Enabled = False
PT_No.Value = True
Else
PT_Yes.Enabled = True
PT_No.Enabled = True
PT_No.Value = True
End If
End If
End If
End With