Unclick Code on Check box command button

  • Thread starter Thread starter Todd
  • Start date Start date
T

Todd

I have code written that when the control check box is
selected certain cells will highligh. I would like for
those same cells to turn white when the check box is
unchecked. What code do I need? Thanks!

Private Sub CheckBox1_Click()
Range("B17:D17").Select
With Selection.Interior
.ColorIndex = 6
.Pattern = xlSolid
.Value = 0


End With
End Sub
 
How about checking if the checkbox is checked or not checked <vbg>?

Option Explicit
Private Sub CheckBox1_Click()
With Me.Range("B17:D17").Interior
If Me.CheckBox1.Value = True Then
.ColorIndex = 6
.Pattern = xlSolid
Else
.ColorIndex = xlNone
End If
End With
End Sub
 
Back
Top