Hide & Unhide with a Checkbox

G

Guest

I want to be able to hide and unhide rows depending if the value of a
checkbox is tru or false but I am getting no results.

Can anyone point me in the wright direction for the code? I am using the
VBA checkbox not the Forms checkbox.

Tia
 
N

Norman Jones

Hi Jonathan,

Try something like:

Private Sub CheckBox1_Click()
Rows("10:20").Hidden = Me.CheckBox1.Value
End Sub
 
G

Guest

Thnx Norman I'll givie it whirl

Norman Jones said:
Hi Jonathan,

Try something like:

Private Sub CheckBox1_Click()
Rows("10:20").Hidden = Me.CheckBox1.Value
End Sub
 
G

Guest

Thanks Norman,

What I mean (have tested and it's fab) but the rows will start hidden on the
sheet - when the user check's the box and creates the Value "True" I want the
rows to be visible when the box is unchecked and the value "False" I want the
rows to be hidden.

Can you help?
 
N

Norman Jones

Hi Jonathan,
What I mean (have tested and it's fab) but the rows will start hidden on
the
sheet - when the user check's the box and creates the Value "True" I want
the
rows to be visible when the box is unchecked and the value "False" I want
the
rows to be hidden.


Try:

Private Sub CheckBox1_Click()
Rows("10:20").Hidden = Not (Me.CheckBox1.Value)
End Sub
 

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