Stuffing Multiple Checkbox Captions
Sandy-
Try this for starters:
Sub Fill_Captions()
Dim ctrl As MSForms.Control
Dim i As Integer
i = 1
For Each ctrl In UserForm1.Controls
If TypeOf ctrl Is MSForms.CheckBox Then
ctrl.Caption = Sheets(1).Cells(i, "A")
i = i + 1
End If
Next
End Sub
---
This assumes the captions you want to use in cells A1:A20 in the first sheet
of your workbook.
HTH
Jason
Atlanta, GA
"Sandy" wrote:
I have a user form with 20 check boxes. I want to loop through them stuffing
the captions with various text retrieved from a worksheet.
The checkboxes are consecutively named checkbox1 to checkbox 20.
for i = 1 to 20 step 1
what goes here?
next i
Thanks,
Sandy
|