Hi there, I have a form which has a number of checkboxes. Is it possible to capture and store the order in which the checkboxes were selected in an array?
So if there are 20 checkboxes and the user selects CheckBox1, CheckBox3, Checkbox18, I want to capture the Control.Value (which I assume is the Checkbox name) and place into an array in the same order it was selected
The code so far is:
So if there are 20 checkboxes and the user selects CheckBox1, CheckBox3, Checkbox18, I want to capture the Control.Value (which I assume is the Checkbox name) and place into an array in the same order it was selected
The code so far is:
Code:
Dim Ctl As Control
For Each Ctl In DocProperties.Controls
If TypeOf Ctl Is MSForms.CheckBox Then
If Ctl Then ChkCount = ChkCount + 1
If Ctl.Value = True Then
ReDim Preserve myArray(ChkCount)
myArray(ChkCount) = Ctl.Caption
End If
End If
Next