Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Help With Runaway Calculation
Hi All,
I need a little guidance. I'm trying to create a Sub that converts temperature from Fahraneit to Celcius and Celcius to Fahrenheit with the Worksheet_Change(ByVal Target As Excel.Range). In my sheet I have set up K20 for inputing Deg F and M20 for inputing Deg C. When you change the value in K20 the corresponding Celcius value is calculated in M20 and vise versa. I have often used the following routine for conversions such as this. Private Sub Worksheet_Change(ByVal Target As Excel.Range) Set isect = Intersect(Target, Range("K20")) If Not isect Is Nothing Then Range("M20").Value = ((Target.Value - 32) * (5 / 9)) End If Set isect = Intersect(Target, Range("M20")) If Not isect Is Nothing Then Range("K20").Value = ((Target.Value + 32) * (9 / 5)) End If End Sub Usually I just multiply or divide the "Target.Value" by a single integer but with the scenario above the values in the cells runaway out of control and return some strange value. Can someone help shed some light on this. I'm open to any kind of alternate method of making the conversion happen when I enter a value into one cell or the other. If more clarity is required please let me know. TIA Pete |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Multi threaded calculation (multi CPU) - impact on calculation spe | Excel Discussion (Misc queries) | |||
Why do I have a runaway cursor in Excel | Excel Discussion (Misc queries) | |||
How do I use a rounded calculation result in another calculation? | Excel Worksheet Functions | |||
How do I use a rounded calculation result in another calculation? | Excel Worksheet Functions | |||
range.calculation with UDF not working when calculation is set to automatic | Excel Programming |