Forum Discussion
tmadaras
Mar 25, 2022Copper Contributor
Change color of cells based on checkbox
I need to get a VBA formula to either hide a cell or change the color to hide the cell values so they are not visible - this will be tied to a checkbox - If the checkbox is true then color for cell is black if checkbox is false then color is grey and have the fill to be grey as well to hide the cell as well.
1 Reply
Sort By
- NikolinoDEGold Contributor
Here is a small VBA example with a sample file.
------------------------
Option Explicit
Private Sub CheckBox1_Click()
If CheckBox1.Value = True Then Range("A3").Interior.ColorIndex = 1 'black Else Range("A3").Interior.ColorIndex = xlNone 'no color
End If
End Sub
----------------
Hope I was able to help you :).
I know I don't know anything (Socrates)
Was the answer useful? Mark them as helpful!
This will help all forum participants.