„Eigenschaft List konnte nicht abgerufen werden . Ungültiges
20.02.2025 10:28:36
nhey
ich lese hier schon mehr als ein Jahr mit und habe auch schon sehr viele Tipps hier im Forum gefunden die mir weitergeholfen haben, besten Dank hierfür an das erstklassige Forum, Mitglieder und Betreiber.
Jetzt stehe ich allerdings vor einem Problem wo ich einfach nicht weiterkommen. Ich möchte Daten (Zeilen) aus einer Tabelle in einem Formular auswählen und einzelne Zellen auch verändern können. Die Combobox zeigt auch brav die vorhandenen Zeilen an , wenn ich jedoch eine Zeile auswähle bekomme ich einen Laufzeitfehler „Eigenschaft List konnte nicht abgerufen werden . Ungültiges Argument“ Jetzt bin ich der absolute VBA Anfänger und denke das ich hier einen kleinen Denkfehler fabriziert habe… Könnte mir jemand auf die Sprünge helfen ??
Meine Tabelle hat 26 Reihen und etwas über 1000 Zeilen. Der Code vom UserForm schaut so aus:
Option Explicit
Private Sub ComboBox1_Change()
Dim ObCb As Object
If ComboBox1.Value > "" Then
For Each ObCb In Me.Controls
If TypeName(ObCb) = "TextBox" Then
ObCb.Value = Range(ObCb.Tag & ComboBox1.List(ComboBox1.ListIndex, 25))
End If
Next ObCb
End If
End Sub
Private Sub CommandButton1_Click()
If ComboBox1.ListIndex = -1 Then Exit Sub
Dim ObCb As Object
If ComboBox1.Value > "" Then
For Each ObCb In Me.Controls
If TypeName(ObCb) = "TextBox" Then
Range(ObCb.Tag & ComboBox1.List(ComboBox1.ListIndex, 25)) = ObCb.Value
End If
Next ObCb
End If
End Sub
Private Sub UserForm_Initialize()
Dim LoLetzte As Long
Dim Loi As Long
LoLetzte = IIf(IsEmpty(Range("A65536")), Range("A65536").End(xlUp).Row, 65536)
ComboBox1.ColumnCount = 26
ComboBox1.ColumnWidths = "30;30;50;30;30;30;0"
For Loi = 1 To LoLetzte
If Cells(Loi, 1) > "" Then
ComboBox1.AddItem Cells(Loi, 1)
ComboBox1.List(ComboBox1.ListCount - 1, 1) = Cells(Loi, 2)
ComboBox1.List(ComboBox1.ListCount - 1, 2) = Cells(Loi, 3)
ComboBox1.List(ComboBox1.ListCount - 1, 3) = Cells(Loi, 4)
ComboBox1.List(ComboBox1.ListCount - 1, 4) = Cells(Loi, 5)
ComboBox1.List(ComboBox1.ListCount - 1, 5) = Cells(Loi, 6)
ComboBox1.List(ComboBox1.ListCount - 1, 6) = Loi
End If
Next Loi
End Sub
Anzeige