|
[广告] VBA代码宝 - VBA编程加强工具 · VBA代码随查随用 · 内置多项VBA编程加强工具 ★ 免费下载 ★ ★ 使用手册★
参与一下。。。- Sub ykcbf() '//2024.3.14
- Dim arr, d
- Application.ScreenUpdating = False
- Set d = CreateObject("Scripting.Dictionary")
- For Each Sht In Sheets
- If InStr(Sht.Name, "版") Then
- With Sht
- r = .Cells(.Rows.Count, 5).End(xlUp).Row
- arr = .[a1].Resize(r, 9)
- End With
- For i = 2 To UBound(arr)
- s = arr(i, 5)
- d(s) = d(s) + 1
- Next
- End If
- Next
- ReDim brr(1 To UBound(arr), 1 To UBound(arr, 2))
- For Each Sht In Sheets
- If InStr(Sht.Name, "版") Then
- With Sht
- r = .Cells(.Rows.Count, 5).End(xlUp).Row
- arr = .[a1].Resize(r, 9)
- End With
- For i = 2 To UBound(arr)
- s = arr(i, 5)
- If d(s) = 1 Then
- m = m + 1
- For j = 1 To UBound(arr, 2)
- brr(m, j) = arr(i, j)
- Next
- End If
- Next
- End If
- Next
- With Sheets("提取不重复项")
- .UsedRange.Offset(1).ClearContents
- .[a2].Resize(m, UBound(arr, 2)) = brr
- End With
- Set d = Nothing
- Application.ScreenUpdating = True
- MsgBox "OK!"
- End Sub
复制代码
|
|