excel 函数计算数值
发布网友
发布时间:2022-05-01 08:02
我来回答
共2个回答
热心网友
时间:2022-06-26 11:24
vba代码如下:
Sub a()
m = ThisWorkbook.Sheets(1).Range("a65535").End(xlUp).Row
For i = 1 To m
If IsEmpty(Cells(i, 2)) Then
t = t + Cells(i, 1)
ElseIf t <> 0 And IsEmpty(Cells(i, 2)) = False Then
t = t + Cells(i, 1)
Cells(i, 3) = t
t = 0
ElseIf t = 0 And IsEmpty(Cells(i, 2)) = False Then
Cells(i, 3) = Cells(i, 1)
End If
Next
End Sub
热心网友
时间:2022-06-26 11:24
是计算B列有数据的行到之前无数据的行的和吗?