faeter87
09-28-2011, 09:07 PM
Can anyone please tell me why this will only run once?
In this sub procedure "F19" is an input cell and "F20" shows the calculated data. It does work, but unfortunately only once. After one input on the excel sheet, all the output cell will show is the previous answer. Why is that?
Sub Reduction()
Dim x As Integer
x = Range("F19").Value
Select Case x
Case Is <= 400
Range("F20").Value = 1
Case 401 To 449
Range("F20").Value = (2.76 - (0.0044 * x))
Case 450 To 599
Range("F20").Value = (1.68 - (0.002 * x))
Case 600 To 699
Range("F20").Value = (1.92 - (0.0024 * x))
Case 700 To 799
Range("F20").Value = (1.08 - (0.0012 * x))
Case 800 To 899
Range("F20").Value = (0.44 - (0.0004 * x))
Case 900 To 1200
Range("F20").Value = (0.32 - (0.0002667 * x))
Case Is > 1201
Range("F20").Value = "NODATA"
End Select
End Sub
In this sub procedure "F19" is an input cell and "F20" shows the calculated data. It does work, but unfortunately only once. After one input on the excel sheet, all the output cell will show is the previous answer. Why is that?
Sub Reduction()
Dim x As Integer
x = Range("F19").Value
Select Case x
Case Is <= 400
Range("F20").Value = 1
Case 401 To 449
Range("F20").Value = (2.76 - (0.0044 * x))
Case 450 To 599
Range("F20").Value = (1.68 - (0.002 * x))
Case 600 To 699
Range("F20").Value = (1.92 - (0.0024 * x))
Case 700 To 799
Range("F20").Value = (1.08 - (0.0012 * x))
Case 800 To 899
Range("F20").Value = (0.44 - (0.0004 * x))
Case 900 To 1200
Range("F20").Value = (0.32 - (0.0002667 * x))
Case Is > 1201
Range("F20").Value = "NODATA"
End Select
End Sub