Dear Guys,
I want to sum a column of datagrid. If there is sample code to solve this please post it. Thanks a lot in adwance.
Printable View
Dear Guys,
I want to sum a column of datagrid. If there is sample code to solve this please post it. Thanks a lot in adwance.
Just loop through the rows and add the values of each row to a variable that holds the sum...
VB Code:
Dim sum as Long With Msflexgrid For i = 0 to .Rows-1 sum = sum + clng(.TextMatrix(i,0)) Next End With
Hi nemaroller,
Thank you for your reply. Sorry I'm not using msflexgrid. I 'm using DataGrid. Can you give me more detailed code please. Thanks a lot in advance.