'###############################################################
'函数作用:获取两栏中相同的数据
'###############################################################
Function Wsame(x As Variant, y As Variant, z As Integer)
Dim I As Long
On Error GoTo Er:
Application.ScreenUpdating = False
For Each Mr1 In x
D = WorksheetFunction.Match(Mr1, y, 0)
If D > 0 Then
I = I + 1
If I = z Then Wsame = Mr1
End If
Next
Application.Volatile
Exit Function
Er:
D = 0
Resume Next
End Function
联系客服