velocity1234
New Member
- Joined
- May 5, 2014
- Messages
- 25
I have the following code in worksheet 1.
I have a RTD feed linked to $F$13 and $F$14. The code will record Higher Highs and Lower Lows from the RTD Feed in Cells F13 and F14. However, when the feed is on and linked to the data source the code does not run. If I type over the code in cell F13 or F14 with a hard number the code works fine.
Here is my code:
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "$F$13" Then
If Target.Value - Target.Offset(0, 2) > 0 Then
Target.Offset(0, 2) = Target.Value
ElseIf Target.Value - Target.Offset(0, 3) < 0 Then
Target.Offset(0, 3) = Target.Value
End If
End If
If Target.Address = "$F$14" Then
If Target.Value - Target.Offset(0, 2) > 0 Then
Target.Offset(0, 2) = Target.Value
ElseIf Target.Value - Target.Offset(0, 3) < 0 Then
Target.Offset(0, 3) = Target.Value
End If
End If
End Sub
I have also tried adding Application.EnableEvents = True to the code, but no luck in getting it to fire off. What am I doing wrong?
Thanks,
I have a RTD feed linked to $F$13 and $F$14. The code will record Higher Highs and Lower Lows from the RTD Feed in Cells F13 and F14. However, when the feed is on and linked to the data source the code does not run. If I type over the code in cell F13 or F14 with a hard number the code works fine.
Here is my code:
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "$F$13" Then
If Target.Value - Target.Offset(0, 2) > 0 Then
Target.Offset(0, 2) = Target.Value
ElseIf Target.Value - Target.Offset(0, 3) < 0 Then
Target.Offset(0, 3) = Target.Value
End If
End If
If Target.Address = "$F$14" Then
If Target.Value - Target.Offset(0, 2) > 0 Then
Target.Offset(0, 2) = Target.Value
ElseIf Target.Value - Target.Offset(0, 3) < 0 Then
Target.Offset(0, 3) = Target.Value
End If
End If
End Sub
I have also tried adding Application.EnableEvents = True to the code, but no luck in getting it to fire off. What am I doing wrong?
Thanks,