Option
Explicit
Private
mavntArray()
As
Variant
Private
Sub
CommandButton1_Click()
Dim
astrArray()
As
String
Dim
lngIndex
As
Long
, ialngCount
As
Long
With
ListBox_Liste
For
lngIndex = 0
To
.ListCount - 1
If
.List(pvargIndex:=lngIndex)
Like
"*"
& TextBox_Suchen.Value &
"*"
Then
ReDim
Preserve
astrArray(ialngCount)
As
String
astrArray(ialngCount) = .List(pvargIndex:=lngIndex)
ialngCount = ialngCount + 1
End
If
Next
If
ialngCount > 0
Then
.List() = astrArray()
End
With
End
Sub
Private
Sub
CommandButton2_Click()
ListBox_Liste.List() = mavntArray()
End
Sub
Private
Sub
UserForm_Activate()
ListBox_Liste.List() = Array(
"dfgsuchgdf"
,
"cdcd"
,
"fgjf"
,
"gh"
, _
"jgsuchhj"
,
"fgh"
,
"fh"
,
"fhsuchfjghk"
,
"zuisuchkuz"
,
"uusuchziuz"
)
mavntArray() = ListBox_Liste.List()
End
Sub