|
代码如下。。。。
Sub 合计()
Dim myr%, myc%
Dim arr, Arr1, Arr2, Brr, Brr2, Arr3, Brr3
Dim i%, j%, m%
Dim sss As Double
Application.ScreenUpdating = False
ReDim Brr(1 To 10000, 1 To 3)
With Sheet1
myr = .[a65536].End(xlUp).Row
'此处需要另类的转置
arr = .Range(.Cells(myr, "f"), .Cells(myr, "t"))
For i = 1 To UBound(arr, 2) Step 3
If arr(1, i) <> Empty Then
n = n + 1
Brr(n, 1) = arr(1, i)
Brr(n, 2) = arr(1, i + 1)
Brr(n, 3) = arr(1, i + 2)
End If
Next
.[v1].CurrentRegion.Offset(1).ClearContents
.[v2].Resize(n, 3) = Brr
End With
Application.ScreenUpdating = True
Beep
End Sub
|
|