VSFlexGrid求和显示在最后一行vb代码
发布网友
发布时间:2024-09-30 13:17
我来回答
共2个回答
热心网友
时间:2024-10-05 12:01
Dim i As Integer
Dim sum1, sum2 As Double
MSFlexGrid1.Rows = MSFlexGrid1.Rows + 1
For i = 1 To MSFlexGrid1.Rows - 2
sum1 = sum1 + CDbl(MSFlexGrid1.TextMatrix(i, 1))
sum2 = sum2 + CDbl(MSFlexGrid1.TextMatrix(i, 2))
Next i
MSFlexGrid1.TextMatrix(MSFlexGrid1.Rows - 1, 1) = sum1
MSFlexGrid1.TextMatrix(MSFlexGrid1.Rows, 2) = sum2
热心网友
时间:2024-10-05 12:05
你在取单价的时候用一个变量进行累加,如何在最后一行显示就可以