On Form Open - Check Boxes

Carly

Active Member
Joined
Aug 21, 2002
Messages
370
I have got a form with some check boxes on that I would like to all be checked initially when the form is opened. The code I am using is as follows:
Code:
Private Sub UserForm_Initialize()

    chk_Original.Value = -1
    chk_BranchManaged.Value = -1
    chk_Nationals.Value = -1
    chk_Dublin.Value = -1
    chk_all.Value = -1
    
End Sub
This works, however, they are slightly greyed out & you have to select them twice before you can remove it. Is there anyway that this can be changed so that it isn't greyed out initially?
 

Excel Facts

Spell Check in Excel
Press F7 to start spell check in Excel. Be careful, by default, Excel does not check Capitalized Werds (whoops)
Just checked this in 2007 and it seems to check the box. So -1 should work to.

Private Sub UserForm_Initialize()
Me.CheckBox1.Value = True
End Sub
 
Upvote 0
In Form's designer right-click checkbox and select Properties. Set Value = False.
 
Upvote 0
Thank you for this...so simple, but the True/False instead of 0/-1 works fine.
 
Upvote 0

Forum statistics

Threads
1,224,517
Messages
6,179,240
Members
452,898
Latest member
Capolavoro009

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top