With ListView1
sum = 0
For Each k In .ListItems
sum = sum + Val(k)
Next
.ListItems.Add , "合计", sum
'上面是计算第一列
For i = 1 To .ColumnHeaders.Count - 1
sum = 0
For Each k In .ListItems
sum = sum + Val(.FindItem(k).SubItems(i))
Next
.ListItems.Item("合计").SubItems(i) = sum
Next i
End With
标准的listview不能合并单元格和固定单元格....要么你多加一样,要么用GirdView控件...
多加一行就不用我给你代码了,,,你既然前面的行都能加上,最后一行会加不上? 至于统计的数据,自己累加就行了
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)