|
[广告] VBA代码宝 - VBA编程加强工具 · VBA代码随查随用 · 内置多项VBA编程加强工具 ★ 免费下载 ★ ★ 使用手册★
Option Explicit
Sub TEST9()
Dim ar, br, i&, j&, k&, r&, dic(1) As New Dictionary, isFlag As Boolean
Application.ScreenUpdating = False
ReDim ar(1)
For i = 0 To 1
ar(i) = Range(Cells(1, i + 7), Cells(Rows.Count, i + 7).End(xlUp)).Value
For k = 1 To UBound(ar(i))
dic(i)(ar(i)(k, 1)) = Empty
Next k
Next i
ar = Range("E1", Cells(Rows.Count, "E").End(xlUp))
For i = 1 To UBound(ar)
br = Split(ar(i, 1), ",")
isFlag = False
For j = 0 To 1
If dic(j).Exists(br(j)) Then isFlag = True: Exit For
Next j
If isFlag = False Then
r = r + 1
ar(r, 1) = ar(i, 1)
End If
Next i
Columns("F").Clear
If r Then [F1].Resize(r) = ar
Erase dic
Application.ScreenUpdating = True
Beep
End Sub
|
评分
-
2
查看全部评分
-
|