Arrays with Userforms

  • Thread starter Thread starter RK
  • Start date Start date
R

RK

Pls help on the syntax to do this:-
Basically, I want to store the results of the checkboxes (for example) in a
Userform in an array variable.

.........
Dim CB(5)
For i = 1 To 5
CB(i) = UserForm1.CheckBoxes(i).Value
Next i
.........

Thanks.
 
Dim CB(5)
For i = 1 To 5
CB(i) = UserForm1.Controls("CheckBox" & i).Value
Next i

assumes your checkboxes are named Checkbox1 to Checkbox5
 
Back
Top