|
本帖最后由 lovily22 于 2014-5-9 17:57 编辑
Dim i&, Myr&, x$, Arr
Dim d, k, t
Set d = CreateObject("Scripting.Dictionary")
Application.ScreenUpdating = False
Sheet17.Activate
[a6:d200].ClearContents
Myr = Sheet2.[a65536].End(xlUp).Row
Arr = Sheet2.Range("a2:l" & Myr)
For i = 1 To UBound(Arr)
If Arr(i, 2) > Sheet4.[c4] Then
If Arr(i, 2) < Sheet4.[e4] Then
If Arr(i, 12) <> 0 Then
x = Arr(i, 5) & "," & Arr(i, 6) & "," & Arr(i, 7) & "," & Arr(i, 8) & "," & Arr(i, 9)
d(x) = d(x) + Arr(i, 12)
End If
End If
End If
Next
k = d.keys
t = d.items
[a2].Resize(d.Count) = Application.Transpose(k) 这里错误
[l2].Resize(d.Count) = Application.Transpose(t)
Application.DisplayAlerts = False
[a2].Resize(d.Count).TextToColumns Destination:=[a2], Comma:=True
Application.DisplayAlerts = True
Application.ScreenUpdating = True
End Sub
|
|