|
[广告] Excel易用宝 - 提升Excel的操作效率 · Excel / WPS表格插件 ★ 免费下载 ★ ★ 使用帮助★
Option Explicit
Sub TEST6()
Dim ar, i&, r&, dic As Object, vKey
Application.ScreenUpdating = False
Set dic = CreateObject("Scripting.Dictionary")
ar = Worksheets(1).[A1].CurrentRegion.Value
For i = 2 To UBound(ar)
dic(ar(i, 1)) = dic(ar(i, 1)) & "," & ar(i, 2)
Next i
ReDim ar(dic.Count, 1)
ar(0, 0) = "购方名称": ar(0, 1) = "订单号"
For Each vKey In dic.keys
r = r + 1
ar(r, 0) = vKey
ar(r, 1) = Mid(dic(vKey), 2)
Next
[E1].Resize(UBound(ar) + 1, 2) = ar
Set dic = Nothing
Application.ScreenUpdating = True
Beep
End Sub
|
评分
-
1
查看全部评分
-
|