To make this work, you need to enable scripting on the rectangles in your display. Right click on the rectangles and choose enable scripting. Then copy and paste the code below into your vba editor.
Code:Private Sub Rectangle1_Click(ByVal lvarX As Long, ByVal lvarY As Long)
Call colorSwitch
End Sub
Private Sub Rectangle2_Click(ByVal lvarX As Long, ByVal lvarY As Long)
Call colorSwitch
End Sub
Private Sub colorSwitch()
If Rectangle1.FillColor = 65280 Then
Rectangle1.FillColor = 16777215
Rectangle2.FillColor = 65280
Else
Rectangle1.FillColor = 65280
Rectangle2.FillColor = 16777215
End If
End Sub
One thing to check would be the names of your rectangles. In the VBA editor goto view, then properties window. Select your rectangles on the display and check the name property in the properties window. The name of the subs above should reflect the names of your rectangles. For example: if the name of your rectangle is "Rectangle6", then the sub above should be named Rectangle6_click not Rectangle1_click.
Hopefully this answers your question. Good luck.