VBA for form check boxes

D

dicko1

Trying to assign a macro to a check box that will hide and unhide rows
depending on whether its checked or not. I can do it using a control
check box, but not a form check box. Any ideas?

Here is the code that works for the control check box:

Private Sub CheckBox1_Change()
If CheckBox1.Value = False Then
Issue_Mgt_Hide ( 'I assigned it to a different macro called
Issue_mgt_hide)
Else
Issue_Mgt_Unhide
End If
End Sub

Thanks for any help!

Ryan
 
J

Joel

I don't think this is the problem. You can try putting a break point in this
code and you will probably get to the break point. The problem is in the
Issue_Mgt_Hide. You are not referencing the worksheet probably. The focus
is on the userform when you activate the check box moving the forcus away
from the active worksheet. Don't use active worksheet.
 
F

FSt1

hi
you can do it with a forms check box IF the check box is on a form. if not
and the check box is on the sheet then use the control check box.

Regards
FSt1
 
S

Shane Devenshire

Hi,

When you say "form check box" do you mean a checkbox on a UserForm in the
VBE or do you mean you have created a sheet which you are using as a form?
 
D

dicko1

hi
you can do it with a forms check box IF the check box is on a form. if not
and the check box is on the sheet then use the control check box.

Regards
FSt1









- Show quoted text -

When I say a form check box, I mean one created from the Form's
Toolbar, not the Control Toolbox. This is created on a sheet.

I'm thinking something like this.....

Sub CheckBox()


If Sheet1.CheckBoxes("Check Box 1").Value = 1 Then
Issue_Mgt_Hide
Else
Issue_Mgt_Unhide
End If


End Sub

Thanks,
 

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