Clever-Excel-Forum

Normale Version: VBA - ComboBox abhängig von Optionsfeldern
Du siehst gerade eine vereinfachte Darstellung unserer Inhalte. Normale Ansicht mit richtiger Formatierung.
Hallo Zusammen,

habe aktuell leider das Problem, dass ich es nicht schaffe, meine ComboBox in Abhängigkeit von insgesamt 4 Optionsfeldern (2 Gruppen) zu füllen.
Ihr könnt mir doch bestimmt helfen   Blush

Meine UserForm ist etwa wie folgt aufgebaut:

System: Optionsfeld 1 und Optionsfeld 2 (1. Gruppe)
Bereich: Optionsfeld 3 und Optionsfeld 4 (2. Gruppe)
WST: ComboBox1

Ich hätte mir das Füllen der ComboBox 1 dann etwa so vorgestellt:

Wenn Optionsfeld 1 und Optionsfeld 3 aktiviert ist, soll in ComboBox1 "125,150 und 175" stehen
Wenn Optionsfeld 1 und Optionsfeld 4 aktiviert ist, soll in ComboBox1 "145,205 und 270" stehen
Wenn Optionsfeld 2 und Optionsfeld 3 aktiviert ist, soll in ComboBox1 "100,125 und 150" stehen
Wenn Optionsfeld 2 und Optionsfeld 4 aktiviert ist, soll in ComboBox1 "150" stehen

Habe schon Google und Youtube durchsucht aber leider nirgends was gefunden :(
Wurde mich freuen, wenn ihr mir helfen könnt.

Beste Grüße,
Daniel
Hallo Daniel,

z.B. so:

Private Sub ComboBox1_DropButtonClick()
Select Case -OptionButton1 & -OptionButton2 & -OptionButton3 & -OptionButton4
Case Is = "1010"
ComboBox1.List = Array(125, 150, 175)
Case Is = "1001"
ComboBox1.List = Array(145, 205, 270)
Case Is = "0110"
ComboBox1.List = Array(100, 125, 150)
Case Is = "0101"
ComboBox1.List = Array(150)
Case Else
ComboBox1.Clear
End Select
End Sub


Gruß Uwe
Hallo Uwe,

Vielen Dank dafür! Hat einwandfrei funktioniert.
Genau so wie ich es wollte :)

Bei dem Projekt werden bestimmt noch die ein oder anderen Fragen aufkommen.
Hoffe ich darf dann wieder stören Blush

Gruß,
Daniel