Conditional Format Stop Light? Can I do This

rockyw

Well-known Member
Joined
Dec 26, 2010
Messages
1,196
Office Version
  1. 2010
Platform
  1. Windows
I have data in a shape from a formula. I tried to change the text color based on a goal but conditional format is grayed out. Is there a way to make a shape change color with conditional formating? If I could change the text or the shape would be great. Thanks for any help.
 

Excel Facts

Using Function Arguments with nested formulas
If writing INDEX in Func. Arguments, type MATCH(. Use the mouse to click inside MATCH in the formula bar. Dialog switches to MATCH.
I tried this but I get an error.
Private Sub Worksheet_Change(ByVal Target As Range)

If Not Intersect(Target, Range("Sheet2!B14")) Is Nothing Then
If IsNumeric(Target.Value) Then
If Target.Value < 5 Then
ActiveSheet.Shapes("Oval 5").Fill.ForeColor.RGB = vbGreen
End If
End If
End If
End Sub
My cell with data is in Sheet2 B14, shape is Oval5 Thanks
 
Upvote 0
All I woiuld like to do is get the shape to be red or green based on the data in Sheet 2 F 14 Thanks
 
Upvote 0
rockyw,

Your code gets half the job done ok.

Try..
Rich (BB code):
Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target, Range("Sheet2!F14")) Is Nothing Then
If IsNumeric(Target.Value) Then
If Target.Value < 5 Then
ActiveSheet.Shapes("Oval 5").Fill.ForeColor.RGB = vbGreen
Else
ActiveSheet.Shapes("Oval 5").Fill.ForeColor.RGB = vbRed
End If
End If
End If
End Sub

NB you refer to B14 in your code then F14 in post #3 ???
Hope that helps.
 
Upvote 0
I tried this but I get no change, the Oval 5 is on a sheet called 2014, the cell I'm looking at is on Sheet2. Is that what is wrong?
 
Upvote 0
I tried this but I get no change, the Oval 5 is on a sheet called 2014, the cell I'm looking at is on Sheet2. Is that what is wrong?

Yes, being in different sheets requires a code change.

This in the Sheet2 code module.
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target, Range("F14")) Is Nothing Then
If IsNumeric(Target.Value) Then
If Target.Value < 5 Then
Sheets("2014").Shapes("Oval 5").Fill.ForeColor.RGB = vbGreen
Else
Sheets("2014").Shapes("Oval 5").Fill.ForeColor.RGB = vbRed
End If
End If
End If
End Sub
 
Last edited:
Upvote 0

Forum statistics

Threads
1,214,646
Messages
6,120,717
Members
448,985
Latest member
chocbudda

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