|
[广告] VBA代码宝 - VBA编程加强工具 · VBA代码随查随用 · 内置多项VBA编程加强工具 ★ 免费下载 ★ ★ 使用手册★
代码如下。。。
Sub 查找()
arr = Sheet1.Range([b4], Cells(Rows.Count, 2).End(3))
Set d = CreateObject("scripting.dictionary")
brr = Sheet1.[c3:l3]
For i = 1 To UBound(brr, 2)
d(CStr(brr(1, i))) = 0
Next
For i = 1 To UBound(arr)
For j = 1 To Len(arr(i, 1))
If d.exists(Mid(arr(i, 1), j, 1)) Then d(Mid(arr(i, 1), j, 1)) = d(Mid(arr(i, 1), j, 1)) + 1
Next
Next
Sheet1.[c4:l4].ClearContents
Sheet1.[c4:l4].Resize(, UBound(brr, 2)) = d.items
Set d = Nothing
Beep
End Sub
|
|