Hi all,,

How i can sum all item on listview column.

Thank you in advance.

Recommended Answers

All 2 Replies

See if this helps :
Assuming that the ListView already have a header, so index i start from 1.
If you don't have header then index start from 0.

Private Sub Command1_Click()
Dim temp As Integer
temp = 0
For i = 1 To ListView1.ListItems.Count
    'temp = temp + Val(ListView1.ListItems.Item(i).Text) ' First Column
    temp = temp + Val(ListView1.ListItems(i).SubItems(1)) ' Second Column 
    'temp = temp + Val(ListView1.ListItems(i).SubItems(2)) ' Third Column
Next i
MsgBox temp
End Sub
commented: Thank You for always helping..i hope you can help me on another thread.. :D +2
commented: Great help :) +3
commented: Very helping person +2
commented: Good. +3

Thank ypu very much jx.
It's what i looking for.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.