|
- Sub vf()
- Dim arr, brr(1 To 1000, 1 To 10)
- Set d = CreateObject("scripting.dictionary")
- For Each sht In Sheets
- If sht.Name Like "*月" Then
- With sht
- r = .Cells(Rows.Count, 1).End(xlUp).row
- arr = .Range("a4:j" & r)
- End With
- For i = 1 To UBound(arr)
- If Not d.exists(arr(i, 1)) Then
- k = k + 1
- d(arr(i, 1)) = k
- For j = 1 To UBound(arr, 2)
- brr(k, j) = arr(i, j)
- Next
- Else
- For j = 2 To UBound(arr, 2)
- brr(d(arr(i, 1)), j) = brr(d(arr(i, 1)), j) + arr(i, j)
- Next
- End If
- Next
- End If
- Next
- Sheets("累计").[a4].Resize(k, UBound(brr, 2)) = brr
- End Sub
复制代码 |
评分
-
1
查看全部评分
-
|