mardi 24 juillet 2018

USERFORM LOOP THROUGH MULITPLE CHECKBOXES TO CHANGE MULTIPLE COMBOBOXES

So i have this string of code... It is in a userform and is all vba based (IE not pulling data from a spreadsheet.)

Private Sub CHECK1_Click()

If CHECK1.value = False Then
    COMBO1.visible = False
        Else
            COMBO1.visible = True
    End If
End Sub

It works for perfectly for exactly one checkbox and combobox pair, I need it to work on all 61 on of them, individually... Being new to this I looked at case select possability but it looks like i would have to spell in out.

the userform is called "ORDER1"

All of the check boxes are named "CHECK1" THROUGH "CHECK61"

They all correspond to the combobox' aptly named "COMBO1" THROUGH "COMBO61"

(CHECK1=COMBO1 throguh the entire form.)

How can I make this work without putting 61 'click' events into the code? oh and I'm on excel 2010




Aucun commentaire:

Enregistrer un commentaire