MrExcel Publishing
Your One Stop for Excel Tips & Solutions

Checkbox captions


Posted by Joe C on June 28, 2001 2:30 PM

I am trying to write the values of checkboxes captions into a array of strings?
I am using the following.
Can someone figure out what Im doing wrong?Private Sub

CommandButton1_Click()
Dim uc(1 To 30) As String

dm = 1

For Each CheckBox In UserForm1.Controls
If CheckBox = True Then

uc(dm) = CheckBox.Caption

dm = dm + 1

End If
Next CheckBox


Posted by Ivan F Moala on June 29, 2001 1:48 AM

Dim uc(1 To 30) As String
Dim dm As Integer
Dim Cbk
dm = 1

For Each Cbk In Me.Controls
If Cbk.Value = True Then

uc(dm) = Cbk.Caption

dm = dm + 1

End If
Next

Posted by Joe C on June 29, 2001 6:09 AM

Thanks worked like a charm.