ich würde gerne erreichen, dass bei markiertem OptionButton2 überprüft wird, ob OptionButton13 oder 14 aktiv sind, wenn nein MsgBox. Ich habe verschiedene Versuche unternommen, bekomme es aber irgendwie nicht hin. Danke schon jetzt für die Rückmeldungen.
Gruß - Wolfgang
Private Sub CommandButton1_Click()
Dim ctrElement As Control
For Each ctrElement In Me.Controls
If TypeName(ctrElement) = "OptionButton" Then
If ctrElement = True Then
Selection = ctrElement.Caption
Exit For
End If
End If
If OptionButton3.Value = True Then
Selection.Offset(0, 1) = "Nein" 'ctrElement = "Nein"
Selection.Offset(0, 11) = "Nein" 'ctrElement = "Nein"
End If
If OptionButton6.Value = True Then
Selection.Offset(0, 1) = "Nein" 'ctrElement = "Nein"
Selection.Offset(0, 11) = "Nein" 'ctrElement = "Nein"
End If
If OptionButton7.Value = True Then
Selection.Offset(0, 1) = "Nein" 'ctrElement = "Nein"
Selection.Offset(0, 11) = "Nein" 'ctrElement = "Nein"
End If
If OptionButton8.Value = True Then
Selection.Offset(0, 1) = "Nein" 'ctrElement = "Nein"
Selection.Offset(0, 11) = "Nein" 'ctrElement = "Nein"
End If
If OptionButton9.Value = True Then
Selection.Offset(0, 1) = "Nein" 'ctrElement = "Nein"
End If
If OptionButton4.Value = True Then
Selection.Offset(0, 1) = "Nein" 'ctrElement = "Nein"
End If
If OptionButton5.Value = True Then
Selection.Offset(0, 1) = "Nein" 'ctrElement = "Nein"
Selection.Offset(0, 11) = "Nein" 'ctrElement = "Nein"
End If
If OptionButton10.Value = True Then
Selection.Offset(0, 1) = "Ja" 'ctrElement = "Ja"
End If
If OptionButton11.Value = True Then
Selection.Offset(0, 1) = "Nein" 'ctrElement = "Nein"
End If
If OptionButton12.Value = True Then
Selection.Offset(0, 1) = "Nein" 'ctrElement = "Nein"
Selection.Offset(0, 11) = "Nein" 'ctrElement = "Nein"
End If
Next ctrElement
Unload Me
End Sub