|
'再凑一个,,,
Option Explicit
Sub test()
Dim arr, dic(2), i, j, key
arr = [a1].CurrentRegion.Resize(, 2).Value
For j = 1 To UBound(arr, 2)
Set dic(j) = CreateObject("scripting.dictionary")
For i = 2 To UBound(arr, 1)
If Len(arr(i, j)) Then dic(j)(arr(i, j)) = dic(j)(arr(i, j)) + 1
Next
Next
ReDim arr(1 To UBound(arr, 1), 1 To 2), m(2)
For i = 1 To 2
For Each key In dic(i).keys
If dic(i)(key) = 1 Xor i = 1 Then m(i) = m(i) + 1: arr(m(i), i) = key
Next
Next
[e2].Resize(UBound(arr, 1), 2) = arr
End Sub |
评分
-
1
查看全部评分
-
|