Private
Sub
Userform_initialize()
Dim
arrData
As
Variant
, iLastRow
As
Integer
With
Worksheets(
"Datenbank1"
)
iLastRow = .Cells(.Rows.Count, 1).
End
(xlUp).Row
arrData = .Range(.Cells(2, 7), .Cells(iLastRow, 3)).Value
End
With
With
ListBox1
.ColumnCount = 5
.ColumnWidths =
"1cm;9cm;3cm;3cm;10cm;"
.ColumnHeads =
False
.List() = arrData
.ListIndex = .ListCount - 1
End
With
End
Sub
Private
Sub
TextBox1_Change()
Dim
arrData
As
Variant
, arrData2
As
Variant
Dim
iLastRow
As
Integer
With
Worksheets(
"Datenbank1"
)
iLastRow = .Cells(.Rows.Count, 1).
End
(xlUp).Row
arrData = .Range(.Cells(2, 6), .Cells(iLastRow, 3)).Value
End
With
If
Not
Trim(TextBox1) = Empty
Then
arrData2 = filter2dArray(arrData,
"*"
& TextBox1.Text &
"*"
)
End
If
If
VarType(arrData2) = Empty
Then
ListBox1.Clear
Else
ListBox1.List() = arrData2
End
If
End
Sub