本帖最后由 wangchs79 于 2018-7-20 07:50 编辑
如何修改下面VBA实现上传附件效果 Sub fz() Dim i&, Myr&, Arr Dim d, k, t Set d = CreateObject("Scripting.Dictionary") [d2:f1000].ClearContents Myr = Sheet1.[a65536].End(xlUp).Row Arr = Sheet1.Range("a1:c" & Myr) For i = 2 To UBound(Arr) ss = Arr(i, 1) & vbTab & Arr(i, 2) d(ss) = d(ss) + Arr(i, 3) Next k = d.keys t = d.items For N = LBound(k) To UBound(k) Cells(N + 2, 4).Resize(1, 3) = Split(k(N), vbTab) Next [f2].Resize(d.Count, 1) = Application.Transpose(t) Set d = Nothing End Sub
|