LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 108
Default worksheet_calculate

I have the following code which updates a cell once a value is entered into
one of the others.

Private Sub worksheet_calculate()
Application.ScreenUpdating = False

If Range("H5") And Range("I5") 0 Then
Range("E5") = "900"
ElseIf Range("H5") Or Range("I5") 0 Then
Range("E5") = "450"
Else
Range("E5") = ""
End If

If Range("H6") And Range("I6") 0 Then
Range("E6") = "900"
ElseIf Range("H6") Or Range("I6") 0 Then
Range("E6") = "450"
Else
Range("E6") = ""
End If

If Range("H7") And Range("I7") 0 Then
Range("E7") = "900"
ElseIf Range("H7") Or Range("I7") 0 Then
Range("E7") = "450"
Else
Range("E7") = ""
End If

Application.ScreenUpdating = True

End Sub

The problem is it takes a long time for the code to run. Can anyone help?
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 11:29 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"