I am trying to change the color of an Oval I have in a chart based on a cell I am referencing. I am trying to use the Oval as a quick indicator of performace. Here is the code I have so far:
Sub Worksheet_Change(ByVal Target As Range)
Set Target = Range("AK11")
If Target.Value = "Green" Then
Shapes("Oval 17").Fill.ForeColor.RGB = RGB(0, 255, 0)
End If
If Target.Value = "Yellow" Then
Shapes("Oval 17").Fill.ForeColor.RGB = RGB(255, 0, 0)
End If
If Target.Value = "Red" Then
Shapes("Oval 17").Fill.ForeColor.RGB = RGB(255, 255, 0)
End If
End Sub
When I run it I get a 'Run-time Error '-147024809 (80070057)' "The item with the specified name wasn't found."
Since my shape is apart of my chart (I can move it out of the chart area) do I need to reference it differently?
Any Help would be Awesome!
John
Sub Worksheet_Change(ByVal Target As Range)
Set Target = Range("AK11")
If Target.Value = "Green" Then
Shapes("Oval 17").Fill.ForeColor.RGB = RGB(0, 255, 0)
End If
If Target.Value = "Yellow" Then
Shapes("Oval 17").Fill.ForeColor.RGB = RGB(255, 0, 0)
End If
If Target.Value = "Red" Then
Shapes("Oval 17").Fill.ForeColor.RGB = RGB(255, 255, 0)
End If
End Sub
When I run it I get a 'Run-time Error '-147024809 (80070057)' "The item with the specified name wasn't found."
Since my shape is apart of my chart (I can move it out of the chart area) do I need to reference it differently?
Any Help would be Awesome!
John