|
代码以附件为准- Sub ykcbf() '//2024.1.31
- Dim arr, d
- Application.ScreenUpdating = False
- Set d = CreateObject("Scripting.Dictionary")
- With Sheets("Sheet1")
- r = .Cells(.Rows.Count, "a").End(xlUp).Row
- arr = .[a1].Resize(r, 3)
- .[i:k] = ""
- .[i1].Resize(UBound(arr), UBound(arr, 2)) = arr
- .[i3:k1000] = ""
- For i = 3 To UBound(arr)
- s = arr(i, 1) & "|" & arr(i, 2) & "|" & arr(i, 3)
- d(s) = d(s) + 1
- Next
- ReDim brr(1 To UBound(arr), 1 To 3)
- For Each k In d.keys
- If d(k) = 1 Then
- m = m + 1
- t = Split(k, "|")
- brr(m, 1) = t(0)
- brr(m, 2) = t(1)
- brr(m, 3) = t(2)
- End If
- Next
- .[i3].Resize(m, 3) = brr
- End With
- Set d = Nothing
- Application.ScreenUpdating = True
- MsgBox "OK!"
- End Sub
复制代码
|
|