Sub 矩形2_单击()
Dim i As Integer
Dim YYY As Integer
For i = 1 To 20
Sheets("sheet1").Cells(i, 1) = i
Next
YYY = Application.WorksheetFunction.CountA(Columns("A"))
Cells(YYY + 1, 1) = Application.WorksheetFunction.Sum(Range(Cells(1, 1), Cells(YYY, 1)))
End Sub
YYY是A列中非空的个数,
vba基础(excel)(3)感谢兰色幻想 ,是对A列所有的都求和(和放在最后一行)
最新推荐文章于 2019-06-27 07:47:17 发布