|
[广告] VBA代码宝 - VBA编程加强工具 · VBA代码随查随用 · 内置多项VBA编程加强工具 ★ 免费下载 ★ ★ 使用手册★
参与一下。。。
- Sub ykcbf() '//2024.4.4
- Set d = CreateObject("Scripting.Dictionary")
- r = Cells(Rows.Count, 1).End(3).Row
- arr = [a1].Resize(r, 9)
- ReDim brr(1 To UBound(arr), 1 To 9)
- For i = 2 To UBound(arr) Step 3
- s = arr(i, 5) & "|" & arr(i + 1, 5) & "|" & arr(i + 2, 5)
- If Not d.exists(s) Then
- d(s) = i
- End If
- Next
- For Each k In d.keys
- t = d(k)
- For x = 1 To 3
- m = m + 1
- For j = 1 To UBound(arr, 2)
- brr(m, j) = arr(t + x - 1, j)
- Next
- Next
- Next
- [l2].Resize(1000, 9) = ""
- [l2].Resize(m, 9) = brr
- MsgBox "OK!"
- End Sub
复制代码
|
|