|
[广告] VBA代码宝 - VBA编程加强工具 · VBA代码随查随用 · 内置多项VBA编程加强工具 ★ 免费下载 ★ ★ 使用手册★
Sub text()
Dim arr, brr, crr
Dim dic, key
Dim x, i, k
Set dic = CreateObject("scripting.dictionary")
arr = Range("c1:c21")
For x = 2 To UBound(arr)
key = arr(x, 1)
dic(key) = ""
Next
brr = Range("e1:f30")
ReDim crr(1 To 199, 1 To 1)
For i = 2 To UBound(brr)
key = brr(i, 1)
If dic.exists(key) Then
brr(i, 2) = "óD"
k = k + 1
crr(k, 1) = key
End If
Next
Range("e:e").NumberFormat = "@"
Range("i:i").NumberFormat = "@"
Range("e1:f30") = brr
Range("i2").Resize(k, 1) = crr
End Sub
|
|