Hello,
I have several checkboxes being used in a form, let's say "CheckBox1", "CheckBox2" and "CheckBox3". I would like to have it happen when one or more of these checkboxes are checked the cell H14 goes from its default state of being greyed out and locked to being white and unlocked, but then if ALL boxes are unchecked I would like the cell H14 to revert back to its default state (grey and locked). What is happening right now is that the cell unlockes if any when one or more boxes are checked, however if any of the boxes are unchecked the cell H14 goes back to being grey and locked even if some of the other boxes are still checked.
This is a sample of the code I am using for each of the checkboxes:
If Me.CheckBox1.Value = False Then
Range("H14").Locked = True
Range("H14").Select
With Selection.Interior
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
.ThemeColor = xlThemeColorDark1
.TintAndShade = -0.149998474074526
.PatternTintAndShade = 0
End With
Else: Me.CheckBox1.Value = True
Range("H14").Locked = False
Range("H14").Select
With Selection.Interior
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
.ThemeColor = xlThemeColorDark1
.TintAndShade = 0
.PatternTintAndShade = 0
End With
End If
I am thinking I need to use an AND in the IF statment but do not know how to do this with more than 2 conditions.
Also, a minor aesthetic thing, is it possible to change the cell to locked/grey or unlocked/white without selecting the cell first?
Thanks!