|
[广告] Excel易用宝 - 提升Excel的操作效率 · Excel / WPS表格插件 ★ 免费下载 ★ ★ 使用帮助★
Sub test()
Dim d, arr, s$, i&
Set d = CreateObject("scripting.dictionary")
arr = Sheet1.UsedRange
For i = 3 To UBound(arr)
If Not d.exists(arr(i, 5)) Then
d(arr(i, 5)) = Array(arr(i, 1), arr(i, 5), Format(arr(i, 2), "m/d"))
Else
s = d(arr(i, 5))(2) & " " & Format(arr(i, 2), "m/d") & " "
d(arr(i, 5)) = Array(d(arr(i, 5))(0), d(arr(i, 5))(1), s)
End If
Next
With Sheet2
.UsedRange.Offset(2).ClearContents
.Range("a3").Resize(d.Count, 3) = Application.Transpose( _
Application.Transpose(d.items))
End With
Set d = Nothing
End Sub
|
评分
-
1
查看全部评分
-
|