|
参与一下。。。- Sub ykcbf() '//2024.1.10
- Dim arr, d
- Set d = CreateObject("Scripting.Dictionary")
- arr = Sheets("Sheet1").UsedRange
- For i = 2 To UBound(arr)
- s = CStr(arr(i, 2))
- If Not d.exists(s) Then
- d(s) = Application.Index(arr, i)
- End If
- Next
- With Sheets("Sheet2")
- .UsedRange.Offset(1).Clear
- .Columns(2).NumberFormatLocal = "@"
- With .[a2].Resize(d.Count, UBound(arr, 2))
- .Value = Application.Rept(d.Items, 1)
- .Borders.LineStyle = 1
- .HorizontalAlignment = xlCenter
- .VerticalAlignment = xlCenter
- End With
- End With
- Set d = Nothing
- MsgBox "OK!"
- End Sub
复制代码
|
评分
-
1
查看全部评分
-
|