Active X Check Box to call up a UserForm

jammoca

Banned
Joined
Nov 6, 2002
Messages
1,100
Hello to all,

there is likely to be a better way to do this, so please, if there is, please let me know.

In the range ... Entry!A4:D300, I have ....

Student ID numbers in Column A
Student Names in Column B
Subject Class Codes in Column C
Subject Teacher Codes in Column D

eg:

80456Abbas, Kasey12MAB101DBRAN
46662Balmer, Ashleigh12MAB101DBRAN
82672Bishop, Hamish12MAB101DBRAN
69626Bridge, Liam12MAB101DBRAN
46283Bultitude, Hamish12MAB101DBRAN
61608Bester, Matthew12MAB102MCUJE
71059Bowden, Alice12MAB102MCUJE
75001Colbrook, Rowena12MAB102MCUJE
70529Dunn, Daniel12MAB102MCUJE
74536Fraser, Joshua12MAB102MCUJE
78312Keech, Jackson12MAB102MCUJE
44087King, Patrick12MAB102MCUJE
81620Curtis, Brooke12MAB301TFLET
55922Dwyer, Rupert12MAB301TFLET
62731Fernando, Natalie12MAB301TFLET
80331Furrer, Isabelle12MAB301TFLET
75653Harper, Pat12MAB301TFLET
72991Kennedy, Maddie12MAB301TFLET
80970Liao, Andy12MAB301TFLET
82123Chang, Matthew12MAB302DBRAN
70047Chu, Matthew12MAB302DBRAN
47549Cunningham, Charlie12MAB302DBRAN
69652Dagg, Jackson12MAB302DBRAN
72841Deeb, Sarah12MAB302DBRAN
83732Deleau, Noémie12MAB302DBRAN
51625Edwards, Savannah12MAB302DBRAN
70509Ferres, Kirsten12MAB302DBRAN

<tbody>
</tbody>

On a different sheet, I have a series of Math subject class codes in the range ... PrintTemplate!Q4:T13 ... many cells have no subject in them ...

12MAB10112MAB302
12MAB102
12MAB30112MAB502 12MAB506
12MAB501
12MAB504

<tbody>
</tbody>

I've positioned an Active X Check Box beside (to the right of) each subject class code (including the cells that are empty) ... these check boxes currently have no code in them .. so the checkbox to the right of the subject class found in PrintTemplate!Q4 refers to the subject class found in PrintTemplate!Q4.

A user is likely to check more than one check box.

When a checkbox is clicked, I'd like the list of students who belong to that class to be displayed in a floating UserForm (perhaps named after the Class it refers to), AND beside each student name in that UserForm, I'd like another checkBox to appear, that if checked will cause three (3) things to happen ... 1) the name of the student the CheckBox refers to should appear in cell ... Print Template!B2 ... 2) the student number of the student the CheckBox refers to should appear in cell ... Print Template!B1 .... and 3) the range ... Print Template!B4:M26 ... should be printed on a single A4 piece of paper.

As I said, a teacher is likely to check more than one CheckBox, so the above three things (culminating in the printing of that cell range) will need to happen for each student chosen, so I'm guessing, once one student has been printed, the three steps need to happen for the next student chosen, and so on, and so forth.

Sometimes, a teacher might want to print the entire class list, and not just choose a few students to print, so perhaps, above the first student in the list (in the floating UserForm) should be the words 'PRINT ALL STUDENTS' with a checkbox beside it, so if checked, would print all the students in the list below it.

I realise this is a huge ask, and if there's a better way to do it, please let me know, but at least this strategy I can comprehend.

Is someone able to help me with the coding of ...

* the CheckBoxes referring to Subject Class Codes in the range ... PrintTemplate!Q4:T13 .. which cause a floating UserForm to appear with the student names for each Subject Class Code chosen
* the CheckBoxes (on the floating UserForm) that refer to each student in the displayed list, that when checked, will do those three (3) things mentioned
* the single CheckBox that will cause the printing for each student in that Subject Class List.

A huge thankyou if anyone can pull this off.

Kindest regards,

Chris Jamieson
 
Last edited:

Excel Facts

Fastest way to copy a worksheet?
Hold down the Ctrl key while dragging tab for Sheet1 to the right. Excel will make a copy of the worksheet.
Doing things like this in my opinion is not the best way to do things:

"I've positioned an Active X Check Box beside (to the right of) each subject class code (including the cells that are empty) ... these check boxes currently have no code in them .. so the checkbox to the right of the subject class found in PrintTemplate!Q4 refers to the subject class found in PrintTemplate!Q4."


Just placing all these checkboxes looks like a lot of work to me unless you have some script doing this.

Why not put a "X" in the column next to your cell and then we could write code to look for a "X" in that column.




And trying to do this would take all sorts of coding to actually create a Useform Checkbox.

"AND beside each student name in that UserForm, I'd like another checkBox to appear"


I think it would be better for you to explain what your wanting and let us suggest how to do this.

And I would attempt to do some of this one step at a time till you see what can be done.

Including code to print all the sheets for you would be another task requiring more code.

Using hundreds of check boxes on your sheet and hundreds of check boxes on a userform is not in my opinion the way to do things

And code would have to be written to place these check boxes in the exact proper location and would require resizing the Userform to fit all these check boxes. And on and on.
 
Upvote 0

Forum statistics

Threads
1,215,598
Messages
6,125,748
Members
449,258
Latest member
hdfarid

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