|
Function compare_data(rn1, rn2)
Application.Volatile
arr = Split("," & rn1, ",")
brr = Split("," & rn2, ",")
Set d = CreateObject("scripting.dictionary")
If UBound(arr) >= UBound(brr) Then
For j = 1 To UBound(arr)
d(arr(j)) = ""
Next j
For j = 1 To UBound(brr)
If d.exists(brr(j)) Then d.Remove brr(j)
Next j
Else
For j = 1 To UBound(brr)
d(brr(j)) = ""
Next j
For j = 1 To UBound(arr)
If d.exists(arr(j)) Then d.Remove arr(j)
Next j
End If
If d.Count > 2 Then
compare_data = "其他"
Else
If UBound(arr) = UBound(brr) Then
compare_data = d.Count
Else
If UBound(arr) < UBound(brr) Then
compare_data = "-" & d.Count
Else
compare_data = "+" & d.Count
End If
End If
End If
End Function
|
|