Set d = CreateObject("Scripting.Dictionary")
For i = 1 To [a65536].End(3).Row
If Cells(i, 1) = [b1] Then
Set d(Cells(i, 1)) = Cells(i, 1)
End If
Next
t = d.items
[d1].Resize(d.Count, 1) = Application.Transpose(t)
End Sub
Sub 查找()On Error Resume Next
Dim icount%, arr, I%, SR, arr1(), n%, s$
Range("L2:Q1000").ClearContents
icount = Range("A65536").End(xlUp).Row
s = InputBox("请输入要查询的关键字:" & Chr(10) & "工号/姓名/年龄/籍贯/身份z号/职务", "查询")
For I = 2 To icount
arr = Application.Transpose(Application.Transpose(Cells(I, 2).Resize(1, 4)))
SR = Join(arr)
If SR Like "*" & s & "*" Then
n = n + 1
ReDim Preserve arr1(1 To n)
arr1(n) = arr
End If
Next
[L2].Resize(n, 4) = Application.Transpose(Application.Transpose(arr1))
MsgBox "共计:" & n & "条数据"
End Sub
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)