View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
PH NEWS PH NEWS is offline
external usenet poster
 
Posts: 11
Default Strange problem with Code

Found the answer to this question, thought I post just in case nyone else if
having the same problem.
The screen updating command solves the problem.
Private Sub Worksheet_Change(ByVal Target As Range)
If Intersect(Target, Range("E2:F3003")) Is Nothing Then
Exit Sub
Else
Application.ScreenUpdating = True
Sheets("Main").Range("G2:M3003").Calculate
Sheets("Main").Range("Q2:Q3003").Calculate
End If
End Sub
"PH NEWS" wrote in message
...
I have this code on a sheet.

Private Sub Worksheet_Change(ByVal Target As Range)
If Intersect(Target, Range("E2:F3003")) Is Nothing Then
Exit Sub
Else
Sheets("Main").Range("G2:M3003").Calculate
Sheets("Main").Range("Q2:Q3003").Calculate
End If
End Sub

The reason I have this code is I have three columns of large array

formulae
at the end of my sheet and keeping the book on auto calc is very slow. The
two ranges I am calculating are conditionally formatted to "black out"
depending on the entry of columns E and F. Everything works fine except

the
conditional formatting, that is to say the "blacking out" isn't instant. I
have to scroll up and then back down to see the "blacking out" has taken
effect.
Am I missing something, some sort of refresh screen function? I have never
had this problem before. Can anyone help?