|
![](https://clubstatic.excelhome.net/image/common/ico_lz.png)
楼主 |
发表于 2017-11-3 14:01
|
显示全部楼层
网络售后跟踪进度表
http://club.excelhome.net/forum. ... 113&pid=9288866
Sub Adele()
Set d = CreateObject("scripting.dictionary")
With Sheets("售后记录表")
n = 1
arr = .Range("a1").CurrentRegion
For x1 = 2 To UBound(arr)
If arr(x1, 1) = "" Then arr(x1, 1) = arr(x1 - 1, 1)
Next
For x = 2 To UBound(arr)
If Not d.exists(arr(x, 1)) Then
d(arr(x, 1)) = Array(arr(x, 2), arr(x, 3), arr(x, 4), arr(x, 14), arr(x, 6), arr(x, 7), arr(x, 8), arr(x, 9), arr(x, 11), arr(x, 12), arr(x, 13), 1)
Else
n = n + 1
k = d(arr(x, 1))
k(8) = k(8) & "," & arr(x, 11)
k(9) = k(9) & "," & arr(x, 12)
k(11) = k(11) & "," & n
d(arr(x, 1)) = k
End If
Next
End With
Sheet2.Activate
s = Range("b5")
If d.exists(s) Then
a = d(s): [c5] = a(0): [d5] = a(1): [e5] = a(2): [f5] = a(10): [g5] = a(6)
s1 = Split(a(11), ","): s2 = Split(a(8), ","): s3 = Split(a(9), ",")
With Application
[b12].Resize(UBound(s1) + 1) = .Transpose(s1)
[d12].Resize(UBound(s2) + 1) = .Transpose(s2)
[f12].Resize(UBound(s3) + 1) = .Transpose(s3)
End With
End If
End Sub |
|