Results 1 to 3 of 3

Thread: Summing datagrid column

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Jun 2002
    Location
    UAE
    Posts
    25

    Summing datagrid column

    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.
    Zaid

  2. #2
    I wonder how many charact
    Join Date
    Feb 2001
    Location
    Savage, MN, USA
    Posts
    3,704
    Just loop through the rows and add the values of each row to a variable that holds the sum...

    VB Code:
    1. Dim sum as Long
    2.  
    3. With Msflexgrid
    4.  
    5. For i = 0 to .Rows-1
    6.   sum = sum + clng(.TextMatrix(i,0))
    7. Next
    8.  
    9. End With

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Jun 2002
    Location
    UAE
    Posts
    25

    Summing Datagrid

    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.
    Zaid

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width