VBA will pick up the value by default in a term such as:
If Range("U117") = 1 then
The intersect function determines whether the ranges overlap, and the arguements for the function must be ranges. Therefore you cannot have the resulting formula of A2 - A1 instead of range("U117").
If you want to determine whether the value of "target" is equal to the value of A2-A1 you need:
Private Sub Worksheet_Change(ByVal Target As Range)
If Target = Range("A2") - Range("A1") Then
If IsNumeric(Target.Value) Then
If Target.Value > 0.4 Then
ActiveSheet.Shapes("FreeForm 9").Fill.ForeColor.RGB = vbRed
ElseIf Target.Value <= 0.4 And Target.Value > 0.05 Then
ActiveSheet.Shapes("FreeForm 9").Fill.ForeColor.RGB = vbYellow
ElseIf Target.Value <= 0.05 Then
ActiveSheet.Shapes("FreeForm 9").Fill.ForeColor.RGB = vbGreen
End If
End If
End If
End Sub
Bookmarks