|
其实也可以很简单。
提供代码及视频解答,希望能够帮助到你!
代码如下:
- Sub byWanao()
- Dim i&, j&, arr, jsNum&
- i = Sheet1.Cells(Rows.Count, 1).End(xlUp).Row
- arr = Sheet1.Range("A1:R" & i)
- For i = 1 To UBound(arr) - 1
- For j = i + 1 To UBound(arr)
- If arr(i, 17) = arr(j, 17) And arr(i, 18) = arr(j, 18) Then
- jsNum = jsNum + 1
- Sheet3.Cells(jsNum, 1).Resize(1, 18) = WorksheetFunction.Index(arr, i)
- jsNum = jsNum + 1
- Sheet3.Cells(jsNum, 1).Resize(1, 18) = WorksheetFunction.Index(arr, j)
- jsNum = jsNum + 1
- End If
- Next
- Next
- End Sub
复制代码 视频讲解地址:
https://www.bilibili.com/video/BV1vv4y1i7So/
|
|