velocity1234
New Member
- Joined
- May 5, 2014
- Messages
- 25
I have the following code. It copies values from one cell to another given a simple criteria when there is a "Change" on the sheet.
The code works, but then it hangs up as if I am overloading the program. Is there an easier way
to code this so it does not hang.
Private Sub Worksheet_Change(ByVal Target As Range)
If Range("LastSPY").Value <= Range("LowestLowSPY").Value Then
Range("LowestLowSPY").Value = Range("LastSPY").Value
End If
If Range("LastSPY").Value >= Range("HighestHighSPY").Value Then
Range("HighestHighSPY").Value = Range("LastSPY").Value
End If
If Range("LastVXX").Value <= Range("LowestLowVXX").Value Then
Range("LowestLowVXX").Value = Range("LastVXX").Value
End If
If Range("LastVXX").Value >= Range("HighestHighVXX").Value Then
Range("HighestHighVXX").Value = Range("LastVXX").Value
End If
End Sub
The code works, but then it hangs up as if I am overloading the program. Is there an easier way
to code this so it does not hang.
Private Sub Worksheet_Change(ByVal Target As Range)
If Range("LastSPY").Value <= Range("LowestLowSPY").Value Then
Range("LowestLowSPY").Value = Range("LastSPY").Value
End If
If Range("LastSPY").Value >= Range("HighestHighSPY").Value Then
Range("HighestHighSPY").Value = Range("LastSPY").Value
End If
If Range("LastVXX").Value <= Range("LowestLowVXX").Value Then
Range("LowestLowVXX").Value = Range("LastVXX").Value
End If
If Range("LastVXX").Value >= Range("HighestHighVXX").Value Then
Range("HighestHighVXX").Value = Range("LastVXX").Value
End If
End Sub