Private
Sub
CommandButton1_Click()
Dim
vle
As
Variant
, flag
As
Boolean
Dim
ary()
As
Variant
, x
As
Long
vle = Selection.Value
If
Len(vle) > 0
Then
flag =
True
ActiveSheet.ListBox1.Clear
If
flag
Then
ary = Sheets(
"A"
).UsedRange.Columns(2).Value
For
x = 1
To
UBound(ary, 1)
If
InStr(ary(x, 1), vle)
Then
_
ActiveSheet.ListBox1.AddItem ary(x, 1)
Next
x
End
If
End
Sub