Worksheet_Change(ByVal Target As Range) NOT WORKING

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,
 
A puzzle - change line below

from this:

Code:
If Len(Addrss) > 0 Then Worksheet_Change (ThisWorkbook.Sheets(1).Range(Addrss))

Code:
If Len(Addrss) > 0 Then Call Worksheet_Change(Me.Range(Addrss))

If still no luck then sorry, not sure why not as ok for me.

Dave
 
Upvote 0

Excel Facts

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying

Forum statistics

Threads
1,217,371
Messages
6,136,171
Members
449,996
Latest member
duraichandra

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top