I am trying to use the code below many times to conditionally colour auto shapes but I don't know how to alter this to reference another cell and change another shape. I have tried just copying and pasting the whole routine again and changing it's name and the cell and shape names but that doesn't work.
Does anyone have any ideas?
Thanks
Private Sub Worksheet_Change(ByVal Target As Range)
If Intersect(Target, Range("fred")) Is Nothing Then Exit Sub
Me.Shapes("bert").Select
With Range("fred")
If .Value > 0 And .Value <= 56 Then
Selection.ShapeRange.Fill.ForeColor.RGB = ThisWorkbook.Colors(.Value)
Else
Selection.ShapeRange.Fill.ForeColor.RGB = 0
End If
.Select
End With
End Sub
Does anyone have any ideas?
Thanks
Private Sub Worksheet_Change(ByVal Target As Range)
If Intersect(Target, Range("fred")) Is Nothing Then Exit Sub
Me.Shapes("bert").Select
With Range("fred")
If .Value > 0 And .Value <= 56 Then
Selection.ShapeRange.Fill.ForeColor.RGB = ThisWorkbook.Colors(.Value)
Else
Selection.ShapeRange.Fill.ForeColor.RGB = 0
End If
.Select
End With
End Sub