View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
mudraker[_143_] mudraker[_143_] is offline
external usenet poster
 
Posts: 1
Default Help With Runaway Calculation

Pete


Try this

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
Stop
If Not (IsNumeric(Target.Value)) Or Target.Value = "" Then
Exit Sub
End If
Application.EnableEvents = False
Select Case Target.Address
Case "$K$20"
Range("M20").Value = ((Target.Value - 32) * (5 / 9))
Case "$M$20"
Range("K20").Value = ((Target.Value + 32) * (9 / 5))
End Select
Application.EnableEvents = True
End Sub


Application.EnableEvents = False is required to stop the change events
being triggered wheen the script changes the value of a cell

Application.EnableEvents = True is required so that the change event is
triggered next time user changes a cell enty


---
Message posted from http://www.ExcelForum.com/