I have created a simple object that I would like to use as a toggle button that when clicked, will color the object and then when clicked again it will return to no color. I have been trying the following code and keep getting different errors. Thanks in advance for your help!
VBA Code:
Sub Rectangle6_Click()
'
' Rectangle6_Click Macro
''
If Rectangle6 = False Then
ActiveSheet.Shapes.Range(Array("Rectangle 6", "Rectangle 19", "Rectangle 20", "Rectangle 21" _
, "Rectangle 22", "Rectangle 23", "Rectangle 24")).Select
With Selection.ShapeRange.Fill
.Visible = msoTrue
.ForeColor.ObjectThemeColor = msoThemeColorText1
.ForeColor.TintAndShade = 0
.ForeColor.Brightness = 0
.Transparency = 0
.Solid
End If
If Rectangle6 = True Then
ActiveSheet.Shapes.Range(Array("Rectangle 6", "Rectangle 19", "Rectangle 20", "Rectangle 21" _
, "Rectangle 22", "Rectangle 23", "Rectangle 24")).Select
Selection.ShapeRange.Fill.Visible = msoFalse
End With
End Sub