Thread: Very Slow code
View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Sandy Sandy is offline
external usenet poster
 
Posts: 270
Default Very Slow code

Why should the following (supposedly simple piece of) code run so slowly:-

Private Sub Worksheet_Change(ByVal Target As Range)

Application.ScreenUpdating = False
Application.EnableEvents = False

For Each mycell In Range("C11:K11,M11:U11")
If mycell.Value = "" Then
mycell.Offset(32).Value = ""
ElseIf mycell.Value = 0 Then
mycell.Offset(32).Value = 0
End If
Next
MsgBox "End"

Application.ScreenUpdating = True
Application.EnableEvents = True

End Sub

Thanks
Sandy