Conditional Format Stop Light? Can I do This

rockyw

Well-known Member
Joined
Dec 26, 2010
Messages
1,191
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

What does custom number format of ;;; mean?
Three semi-colons will hide the value in the cell. Although most people use white font instead.

rockyw

Well-known Member
Joined
Dec 26, 2010
Messages
1,191
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
 

rockyw

Well-known Member
Joined
Dec 26, 2010
Messages
1,191
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
 

Snakehips

Well-known Member
Joined
May 17, 2009
Messages
5,654
Office Version
  1. 365
  2. 2010
Platform
  1. Windows
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.
 

rockyw

Well-known Member
Joined
Dec 26, 2010
Messages
1,191
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?
 

Snakehips

Well-known Member
Joined
May 17, 2009
Messages
5,654
Office Version
  1. 365
  2. 2010
Platform
  1. Windows
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:

Forum statistics

Threads
1,175,794
Messages
5,899,535
Members
434,780
Latest member
andreeajc

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
Top