vendredi 23 septembre 2016

msgbox when all checkboxes empty

I am trying to build a code which will warn the user with a message box if all checkboxes are left empty in my userform. Any help on how to refer to all checkbox controls in one userform to build out this code would be appreciated. Below is an example of the code I have tried, but it does not work.

Dim Allcheckbox As Variant

Allcheckbox = Array("checkbox1", "checkbox2", "checkbox3", "checkbox4", "checkbox5", "checkbox6") If Controls(Allcheckbox).Value = False Then MsgBox ("Please select a comparison criteria.") End If




Aucun commentaire:

Enregistrer un commentaire