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列中非空的个数,