Hallo,
Private Sub CommandButton1_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, ary(x, 2), vle) Then
.AddItem
.List(.ListCount - 1, 0) = ary(x, 1)
.List(.ListCount - 1, 1) = ary(x, 2)
.List(.ListCount - 1, 2) = ary(x, 3)
End If
Next x
End If
End With
End Sub
Sabina
|