发布网友 发布时间:2022-05-12 20:26
共1个回答
热心网友 时间:2023-10-21 10:21
测试通过的程序代码:
Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)
Dim arr, i&, j&, r(1 To 100, 1 To 1)
arr = Me.UsedRange.Resize(, 3)
For i = 2 To UBound(arr)
If arr(i, 1) <> "" Then j = j + 1
r(j, 1) = r(j, 1) + arr(i, 3)
Next i
Sheets(1).Range("b2").Resize(j, 1) = r
End Sub