I have sheet which contatins of Oval shape image like "Oval 1" and in sheet 1 cell D2 is less than =98% then then Oval 1 then outline should be red and if the cell value D2 is >98% then oval 1 share outline should change to green.
Private Sub Worksheet_Change(ByVal Target As Range)
Set Target = Range("D2")
If Target.Value <= 98 Then
With Shapes("Oval 1")
.Line.Weight = 3
.Line.ForeColor.RGB = RGB(255, 0, 0)
.Line.Visible = msoTrue
End With
Else
With Shapes("Oval 1")
.Line.Weight = 3
.Line.ForeColor.RGB = RGB(0, 255, 0)
.Line.Visible = msoTrue
End With
End If
End Sub
not sure its not workingCode:Private Sub Worksheet_Change(ByVal Target As Range) Set Target = Range("D2") If Target.Value <= 98 Then With Shapes("Oval 1") .Line.Weight = 3 .Line.ForeColor.RGB = RGB(255, 0, 0) .Line.Visible = msoTrue End With Else With Shapes("Oval 1") .Line.Weight = 3 .Line.ForeColor.RGB = RGB(0, 255, 0) .Line.Visible = msoTrue End With End If End Sub