Set checkboxes(checkboxCount).Checkboxgroup = ctl
06.05.2013 18:29:12
Simon
Vielleicht könnt Ihr mir helfen. Ich versuche rauszufinden, was genau diese Befehlszeile macht: Was kann man anders schreiben? Wieso brauche ich sie? Danke!
Set checkboxes(checkboxCount).Checkboxgroup = ctl
Der Rest vom Code ist der hier:
Dim checkboxes() As New CbClass
Private Sub UserForm_Initialize()
Dim checkboxCount As Integer
Dim ctl As Control
'Create the Button objects
ButtonCount = 0
For Each ctl In Wochenplan.Controls
If TypeOf ctl Is MsForms.CheckBox Then
checkboxCount = checkboxCount + 1
ReDim Preserve checkboxes(1 To checkboxCount)
Set checkboxes(checkboxCount).Checkboxgroup = ctl '
End If
Next ctl
End Sub
Public WithEvents Checkboxgroup As MsForms.CheckBox
Private Sub Checkboxgroup_click()
Dim cb As MsForms.CheckBox
Dim i As Integer
For Each cb In Wochenplan.Controls
If cb.Value = True Then
MsgBox ("Wahr")
End If
Next