Here's your macro:
Sub Auto_Color_FreeForm()
With ThisWorkbook.Worksheets("Sheet1")
If .Range("A1") = ThisWorkbook.Worksheets("Sheet2").Range("D3") Then _
.Shapes("Freeform 1").Fill.ForeColor.RGB = RGB(0, 180, 0) Else _
.Shapes("Freeform 1").Fill.ForeColor.RGB = RGB(79, 129, 189)
End With
End Sub
to automate this, you will need to call this from the "Workbook_SheetChange" event of the workbook; like this
Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)
Call Auto_Color_FreeForm
End Sub
so that the code runs everytime the user changes something and evaluates the condition.
Bookmarks