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 i...
NikolinoDE
Mar 26, 2022Gold 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.