Sub test()
M = ActiveSheet.Range("B65536").End(xlUp).Row 'B列的数据最后一行的行号
N = ActiveSheet.Range("L65536").End(xlUp).Row 'L列数据的最后一行的行号
R = 0
H = 2
Dim X, Y As String
For i = 2 To M
For j = 2 To N
X = Range("L" & j)
For k = 1 To 3
Y = Mid(Range("B" & i), k, 1)
If InStr(X, Y) > 0 Then R = R + 1
Next
If R = 3 Then
Range("M" & H) = Range("L" & j)
H = H + 1
End If
R = 0
Next
Next
MsgBox "数据处理完毕 "
End Sub
尝试一下 用这个VBA代码吧……
- 相关评论
- 我要评论
-