Gruppe
Dialog
Problem
Wie kann ich über eine Schaltfläche abfragen, welche CheckBoxes einer UserForm aktiviert sind?
ClassModule: frmCheckBoxesValue
Private Sub cmdAbfragen_Click()
Dim cnt As Control
Dim iValues As Integer
Dim arr() As Boolean
For Each cnt In Controls
If Left(cnt.Name, 8) = "CheckBox" Then
iValues = iValues + 1
ReDim Preserve arr(iValues)
arr(iValues) = cnt.Value
End If
Next cnt
For iValues = 1 To UBound(arr)
If arr(iValues) = True Then
MsgBox "CheckBox Nr. " & iValues & " aktiviert!"
End If
Next iValues
End Sub
Private Sub cmdWeiter_Click()
Unload Me
End Sub
StandardModule: basMain
Sub CallForm()
frmCheckBoxesValue.Show
End Sub