Checkbox checked then show more checkboxes

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?
 
D

Dave Peterson

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
 
S

Sara

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.
 
D

Dave Peterson

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"
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top