Which CheckBox checked?

  • You need to use a Class Module.


    The code that adds the checkboxes to the user form also needs to add each check box to the class module. You also need a label on the user form to display the number of check boxes that have been checked.


    Each time a check box gets changed (checked or unchecked) the procedure in the class module will pick up the change and modify the label on the user form.

    We now have a reputation system in place. If my reply helped please "Like" the reply by clicking the "Like" icon at bottom right of my reply.

  • I am tied up with something else right now but will have a go at it when I get a chance.

    We now have a reputation system in place. If my reply helped please "Like" the reply by clicking the "Like" icon at bottom right of my reply.

  • Your code creates a new UserForm every time it runs. Do you really need it to do that, or can it just create a new UserForm1 which would replace an existing UserForm1?

    We now have a reputation system in place. If my reply helped please "Like" the reply by clicking the "Like" icon at bottom right of my reply.

  • OK, that simplifies it a bit! Leave it with me and I will see what I can do.

    We now have a reputation system in place. If my reply helped please "Like" the reply by clicking the "Like" icon at bottom right of my reply.

  • Just realised I forgot to update the Class Module code from where I was trying to make it dynamic for a newely created Userform with an unknown Name.


    You can change the code in the clsChkBxs Class Module to this

    We now have a reputation system in place. If my reply helped please "Like" the reply by clicking the "Like" icon at bottom right of my reply.

  • The file I added earlier will create UserForm1, allow you to use it, then remove it.


    If you want to retain the created Userform1 for later use then use the attached. The top button will create a new UserForm1 (after removing an existing UserForm1), and the lower button will show the existing UserForm1


    Note: In order to use this file you will need to add a reference to the VB before clicking the button to create a new UserForm.

    • Open VB Editor
    • Click "Tools" in menu bar
    • Select References
    • If "Microsoft Visual Basic for Applications Extensibility 5.3" is not already checked, scroll down to it and check it, then click OK

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!