vendredi 1 décembre 2023

Assign code to multiple commandbuttons via loop

I am currently working on a vocabulary programm. That includes choosing which chapters (1-35) should be checked. I have a userform with 35 checkboxes. I have assigned the properties for the checkboxes via loop. Now I have to give every checkbox a induvidial code, the code is:

Privat Sub Checkbox1()
Chapters_checked(Chapter_number)=true
End sub

Chapters_checked is an array which stores, wheather a chapter needs to be checked or not. As you can see the code can be written with a loop, but I do not know how to give every checkbox a code with a loop. Anyone has an idea? Conrad

I did not try anything, since I did not found the tag "code"




Aucun commentaire:

Enregistrer un commentaire