how can you add multiple checkboxes to a userForm Frame? This seems like a trivial thing to do, but my code is only generating a checkbox for last item in array.
Private Sub btnGenerate_Click()
Dim i As Long
Dim lic As licence
Dim temp As Variant
Dim desc As String
Dim chkbox As MSForms.CheckBox
Dim str As String
For Each lic In licenceCollection
temp = lic.getClause
Next lic
For i = LBound(temp) To UBound(temp)
'Debug.Print temp(i)
desc = "Future-Sampling " & i
'Utility.createCheckBoxes temp(i), desc
Set chkbox = licenceForm.resultFrame.Controls.Add("Forms.Checkbox.1", desc)
chkbox.Caption = temp(i)
chkbox.Value = desc
chkbox.Width = "450"
chkbox.Height = "50"
chkbox.WordWrap = True
chkbox.Value = False
chkbox.GroupName = "Future Sampling"
Next
End Sub
Any suggestions here much appreciated. Thanks in advance.
NextandNext iat all. It's purely a matter of preference and coding style.