Den Code habe ich aktuell so:
Private Sub CommandButton3_Click()
Dim vle As Variant, flag As Boolean
Dim ary() As Variant, x As Long
With Me.ListBox1
vle = Selection.Value
If Len(vle) > 0 Then flag = True
.Clear
.ColumnCount = 3
If flag Then
ary = Sheets("A").UsedRange.Value
For x = 1 To UBound(ary, 1)
If InStr(1, vle, ary(x, 2), vbTextCompare) Then _
.AddItem
.List(.ListCount - 1, 0) = ary(x, 1)
.List(.ListCount - 1, 0) = ary(x, 2)
.List(.ListCount - 1, 0) = ary(x, 3)
Next x
End If
End With
End Sub
Leider zeigt es mir in der Zeile:
.List(.ListCount - 1, 0) = ary(x, 1)
einen Laufzeitfehler 381 an. "Eigenschaft List konnte nicht gesetzt werden. Index des Eigenschaftenfelds ungültig. Und ich komme nicht weiter. Könnt ihr mir helfen?