Conditional formatting on autoshapes

  • Thread starter Thread starter jeff g
  • Start date Start date
J

jeff g

Does anyone know how to change the color of an autoshape
based on an answer given in another cell of the same
workbook?

I need to be able to turn an autoshape red, yellow and
green based on criteria established by my client.

Thanks,

Jeff
..
 
You could use the Worksheet_Change event to colour the AutoShape. For
example, if cell C8 will change:

'======================
Private Sub Worksheet_Change(ByVal Target As Range)
Dim shp As Shape
Set shp = ActiveSheet.Shapes("AutoShape 1")

Select Case Range("C8").Value
Case Is >= 20
shp.Fill.ForeColor.SchemeColor = 57
Case Is >= 10
shp.Fill.ForeColor.SchemeColor = 13
Case Else
shp.Fill.ForeColor.SchemeColor = 10

End Select

End Sub
'============================

To add the code to your workbook, right-click on the sheet tab, choose
View Code, and paste in the code. Substitute your cell references and
conditions.
 
Back
Top