ComboBox1 und 2 OK ComboBox3 nicht
27.01.2006 12:13:38
Josef
Mit dem untenstehenden Code werden Namen aus der Tabelle2 in die jeweilige ComboBox eingelesen.
ComboBox1: ComboBox1 wird sichtbar wenn in der Textbox eine 1 steht und die Daten von der Spalte G werden eingelesen.
ComboBox2: ComboBox2 wird sichtbar wenn in der Textbox eine 2 steht und die Daten von der Spalte H werden eingelesen.
ComboBox3: ComboBox3 wird nicht sichtbar wenn in der Textbox eine 3 steht und keine Daten von der Spalte I eingelesen.
Warum bitte nicht? Wo liegt hier der Fehler bitte?
Danke
Josef
Private Sub UserForm_Initialize()
Dim My_Array As Variant
Dim My_Array1 As Variant
Dim My_Array2 As Variant
ComboBox1.Visible = False
ComboBox2.Visible = False
ComboBox3.Visible = False
If TextBox4.Text = "1" Then
ComboBox1.Visible = True
My_Array = Workbooks("Barcode.xla").Worksheets("Tabelle2").Range("$G$2:$G$20")
ComboBox1.List = My_Array
Else
If TextBox4.Text = "2" Then
ComboBox2.Visible = True
If ComboBox2.Visible = True And TextBox4.Text = "2" Then
My_Array1 = Workbooks("Barcode.xla").Worksheets("Tabelle2").Range("$H$2:$H$20")
ComboBox2.List = My_Array1
Else
If TextBox4.Text = "3" Then
ComboBox3.Visible = True
If ComboBox3.Visible = True And TextBox4.Text = "3" Then
My_Array2 = Workbooks("Barcode.xla").Worksheets("Tabelle2").Range("$I$2:$I$20")
ComboBox3.List = My_Array2
End If
End If
End If
End If
End If
End Sub