I am trying to change the font colour in a shape depending on the value of a cell on a different sheet and keep getting
Run-time error '1004':
Private Sub Colours()
Dim firstSheet As Worksheet, secondSheet As Worksheet
Set firstSheet = Sheets("Stats - Overall")
Set secondSheet = Sheets("Dashboard")
If firstSheet.Range("I41") > 0 Then
secondSheet.Shapes("Freeform: Shape 19").TextFrame.Characters.Font.Color = RGB(69, 255, 69)
ElseIf firstSheet.Range("I41") < 0 Then
secondSheet.Shapes("Freeform: Shape 19").TextFrame.Characters.Font.Color = RGB(255, 0, 0)
Else
secondSheet.Shapes("Freeform: Shape 19").TextFrame.Characters.Font.Color = RGB(250, 200, 15)
End If
End Sub
I cannot figure our what is wrong.