Checkbox checked then show more checkboxes

  • Thread starter Thread starter Sara
  • Start date Start date
S

Sara

I have added checkboxes from Control Toolbox and they seem to work fine. I
just want to make one of them lets say checkbox3 to show more checkboxes when
checkbox3 is marked. How do I do that?
 
I'd add them all to exactly where I wanted them.

But then have the "master" checkbox just unhide/hide the others.

Option Explicit
Private Sub CheckBox3_Click()
Dim ShouldBeVisible As Boolean

ShouldBeVisible = CBool(Me.CheckBox3.Value = True)

Me.CheckBox1.Visible = ShouldBeVisible
Me.CheckBox2.Visible = ShouldBeVisible
Me.CheckBox4.Visible = ShouldBeVisible
Me.CheckBox5.Visible = ShouldBeVisible
End Sub
 
Thanks Dave. That works perfectly.

I also want to tie the same checkbox (checkbox3) to hide the values in cell
B41 and B45 if it is checked. Is their a way to just hide the cell text
rather than hidding the entire row or a column? I am not sure how to write
the code for a specific cell.
 
You can make the cell look empty in the worksheet (not in the formula bar).

You could use the same font color as fill color (white on white) or use a custom
format of:
;;;
(3 semicolons)

me.range("b41,b45").numberformat = ";;;"
and to see it:
me.range("b41,b45").numberformat = "General"
 
Back
Top