Clever-Excel-Forum

Normale Version: Kombination verschiedener OptionButton Value. True
Du siehst gerade eine vereinfachte Darstellung unserer Inhalte. Normale Ansicht mit richtiger Formatierung.
Hallo zusammen, :)

Ich bringe folgendes Problem mit:
Ich habe in einer UserForm 5 Frames mit insgesamt 20 OptionButton.
Nun würde ich gerne meine verschiedene Kombinationen abfragen und bei einem Treffer ein Modul in einer anderen Datei ansprechen.
Wenn wir davon ausgehen das folgende Kombination etwas auslösen soll:  
OptionButton1.Value = True And OptionButton3.Value = True And OptionButton14.Value = True And OptionButton12.Value = True And OptionButton7.Value = True) Then GoTo

Wie kann ich es so schreiben das auch wirklich alle diese OptionButton auf True stehen müssen und ich noch weitere andere Kombinationen hinzufügen kann.

Hoffe das es irgendwie verständlich ist.

Schonmal Vielen Dank. :)
Hallo Pascala,

z.B. per Select Case:

Code:
Private Sub UserForm_Click()
  Dim i As Long
  Dim strOptions As String
  For i = 1 To 20
    strOptions = strOptions & Abs(Me.Controls("OptionButton" & i))
  Next i
  Select Case strOptions
    Case "10100010000101000000"
      'Application.Goto
      MsgBox strOptions
    Case "10100100010100000000"
      'Application.Goto
      MsgBox strOptions
    Case Else
      MsgBox "Keine passenden Kombinationen gefunden."
  End Select
End Sub
Vielen Dank!

Hat Super geklappt. :)