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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top