Butting in ... I added some comments. See if they help
Put your cursor on a VBA word and hit F1 to get help
Option Explicit
'this macro is assigned to SquareButton on Sheet1
Sub KedTest()
'if Oval 1 on Sheet1 has a Fill Foreground color = BLUE then ....
If Sheet1.Shapes("Oval 1").Fill.ForeColor.RGB = RGB(255, 192, 0) Then
'make Oval 1 on Sheet1's Fill Foreground color = ORANGE
Sheet1.Shapes("Oval 1").Fill.ForeColor.RGB = RGB(0, 112, 192)
'otherwise
Else
'make Oval 1 on Sheet1's Fill Foreground color = ORANGE
Sheet1.Shapes("Oval 1").Fill.ForeColor.RGB = RGB(255, 192, 0)
End If
End Sub
'more concise
Sub KedTestNew()
With Sheet1.Shapes("Oval 1").Fill.ForeColor
If .RGB = RGB(255, 192, 0) Then
.RGB = RGB(0, 112, 192)
Else
.RGB = RGB(255, 192, 0)
End If
End With
End Sub
'even more concise
Sub KedTestNew2()
With Sheet1.Shapes("Oval 1").Fill.ForeColor
.RGB = IIf(.RGB = RGB(255, 192, 0), RGB(0, 112, 192), RGB(255, 192, 0))
End With
End Sub