求救!没办法,实在是不知为什么,请看代码(函数的结果会有很多的空单元格,真是奇怪?)
Function Hre(rng As Range, rng1 As Range, n)
Application.Volatile
Dim Arr1()
Dim Arr2()
Dim Arr
t1 = rng.Count
t2 = rng1.Count
ReDim Arr1(t1)
ReDim Arr2(t2)
For i = 1 To t1
Arr1(i) = rng.Cells(i)
Next
For i = 1 To t2
Arr2(i) = rng1.Cells(i)
Next
For i = 1 To t1
For j = 1 To t2
If Arr1(i) = Arr2(j) Then
Arr1(i) = "-----"
Arr2(j) = "-----"
Exit For
End If
Next
Next
t = Join(Arr1) & Join(Arr2)
t = Trim(Replace(t, "-----", "")) '为什么这里用trim函数不管用呢?
Arr = Split(t)
Hre = Arr(n - 1)
End Function
2R0w654U.rar
(12.34 KB, 下载次数: 85)
[此贴子已经被作者于2005-4-14 17:56:35编辑过] |