Hi, hope you guys can help - VBA virgin here...
I'm employing the script below to change the fill color of 'FreeForm 9' autoshape based on the value in cell 'U117'.
I understand that if cell 'U117' has a formula in it rather than a simple value, VBA will not use the resulting value.
How can I replace the "U117" reference in the script and use the resulting value from a formula subtracting A1 - A2 instead?
Thanks for any advice .
Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target, Range("U117")) Is Nothing 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