looping through all checkbox's in a userform

  • Thread starter Thread starter strataguru
  • Start date Start date
S

strataguru

Hi,

I have 35 checkboxes in my userform.

For each checkbox that is true I will do 'x'.

Anyone know the syntax to loop through all the checkboxes?

Thanks,
Robin
 
Hi Robin:

Dim ctl As Control
For Each ctl In UserForm1.Controls
If TypeOf ctl Is MSForms.CheckBox Then
If ctl Then
'your code here
End If
End If
Next

Regards,

Vasant.
 
Back
Top