|
发表于 2014-9-24 20:03
|
显示全部楼层
本楼为最佳答案
Private Sub CommandButton5_Click()
tim = Timer
Dim BRR()
Set D = CreateObject("scripting.dictionary")
For I = 1 To UBound(Arr)
If TextBox2 <> "" Then
If InStr(Arr(I, 1) & Arr(I, 2), LCase(TextBox2.Value)) Then
D(Arr(I, 1)) = Arr(I, 2)
End If
Else
D(Arr(I, 1)) = Arr(I, 2)
End If
Next
With ListBox2
For I = .ListCount - 1 To 0 Step -1
If Not .Selected(I) Then
If D.exists(.List(I, 0)) Then D.Remove .List(I, 0)
Else
.RemoveItem (I)
TextBox4.Value = TextBox4.Value - 1
End If
Next
End With
K = D.KEYS
T = D.ITEMS
ReDim BRR(1 To D.Count, 1 To 2)
For I = 0 To D.Count - 1
BRR(I + 1, 1) = K(I)
BRR(I + 1, 2) = T(I)
Next
With ListBox1
.Clear
.List = BRR
End With
TextBox3 = D.Count
MsgBox "总计用时 " & Format(Timer - tim, "0.00") & " 秒!!", 64, "提示"
End Sub |
|