I have a long code that worked perfectly before. When I added some code regarding shape fill colour I had a runtime error 438. I removed this code and tested it on a seperate tab to see what the problem is but I still get the error. I have written code before to fill a shape a certain colour and never had this problem. I am really confused. Here is the simple code
Private Sub CommandButton1_Click()
If Range("L14").Text = "Red" Then
ActiveSheet.Shapes("Oval 7").Select
ActiveSheet.Shapes("Oval 7").Fill.ForeColor.RBG = RGB(255, 0, 0)
ElseIf Range("L14").Text = "Amber" Then
ActiveSheet.Shapes("Oval 7").Select
ActiveSheet.Shapes("Oval 7").Fill.ForeColor.RBG = RGB(192, 80, 77)
ElseIf Range("L14").Text = "Green" Then
ActiveSheet.Shapes("Oval 7").Select
ActiveSheet.Shapes("Oval 7").Fill.ForeColor.RBG = RGB(192, 80, 77)
End If
End Sub
If I enter Green into L14 the line error occurs at the line in bold. What am I doing wrong?
Bookmarks