|
- Sub gj23w98()
- Set d = CreateObject("Scripting.Dictionary")
- arr = Sheet1.[a1].CurrentRegion
- m = UBound(arr): n = UBound(arr, 2)
- ReDim brr(1 To m, 1 To n)
- For i = 2 To m
- s = arr(i, 1)
- If arr(i, 8) < 0 Then
- If d(s) = "" Then
- k = k + 1: d(s) = k: brr(k, 1) = s
- For j = 2 To n
- brr(k, j) = arr(i, j)
- Next
- Else
- For j = 4 To n
- If Len(arr(i, j)) Then
- brr(d(s), j) = brr(d(s), j) + arr(i, j)
- End If
- Next
- End If
- End If
- Next
- If k Then
- [a1].CurrentRegion.Offset(1).ClearContents
- [a2].Resize(k, UBound(brr, 2)) = brr
- End If
- End Sub
复制代码 |
|