|
-
April 7th, 2001, 03:52 PM
#1
Add numbers
Hi Everyone,
I have added a ListView control to a form with 4 columns. I would like to add the numbers together that are in column 2 to come up with a total for that column. Does anyone have any ideas how to go about accomplishing this? I would appreciate any help. Thank you.
-
April 8th, 2001, 06:28 PM
#2
Re: Add numbers
This should do what you are trying to do. THe sample assumes the column to Total is Column 2
---> Subitems(1)
private Sub Command1_Click()
Dim x as Integer
Dim Total as Long
for x = 1 to listView1.ListItems.Count
Total = Total + CLng(lv.ListItems(x).SubItems(1))
next x
MsgBox Format(Total, "###,###,###,##0")
End Sub
John G
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|