Sorry not .Shadow, but .Fill (see code below)
I also tried to hide the cell's value (true or false) with editing the font color. Better is to control it with conditional formatting while formatting the cell's background color.
Sub Rectangle_Toggle(Button As Variant)
With Application.ActiveSheet.Shapes(Button)
'Transparency of the shape 1 = transparent, 0 = solid
.Fill.Transparency = 1
'Hides the cell's value
Range(.TopLeftCell.Address).Font.Color = Range(.TopLeftCell.Address).Interior.Color
If .TextFrame.Characters.Text = "X" Then 'Chr$(252) Then
.TextFrame.Characters.Text = ""
.Fill.ForeColor.RGB = RGB(255, 255, 255)
Range(.TopLeftCell.Address).Value = False
Else
.TextFrame.Characters.Text = "X" 'Chr$(252)
.Fill.ForeColor.RGB = RGB(46, 208, 80) '(50, 195, 50) <-- change your color here
Range(.TopLeftCell.Address).Value = True
End If
End With
End Sub
Bookmarks