Gruppe
Dialog
Problem
Wie kann ich feststellen, welches Optionsfeld in einer UserForm aktiviert wurde?
ClassModule: frmAuslesen
Private Sub cmdAuslesen_Click()
Dim cnt As Control
Dim iCounter As Integer
For Each cnt In Controls
If TypeName(cnt) = "OptionButton" Then
iCounter = iCounter + 1
If cnt.Value = True Then Exit For
End If
Next cnt
MsgBox "Optionsfeld Nr. " & iCounter & _
" wurde ausgewählt!"
End Sub
Private Sub cmdWeiter_Click()
Unload Me
End Sub
StandardModule: basMain
Sub CallForm()
frmAuslesen.Show
End Sub