i have msflexgrid with 4 columns; date, Name, Agent and Amount. Am looking for help on how i can show totals on the amount column to show below the last figure on the amount column..

i will appreciate any suggestion or help


Make sure you have one more row for sum of amount

Try :

    Dim temp As Integer
    temp = 0

    For i = 1 To MSFlexGrid1.Rows - 1
        temp = temp + Val(MSFlexGrid1.TextMatrix(i, 4))
    Next i

    'set sum of amount to last row
    MSFlexGrid1.TextMatrix(MSFlexGrid1.Rows - 1, 4) = temp


commented: Nice +3

hi Jx Man,
thannx a lot for your quick response...but wat do u mean have an extra row.

but wat do u mean have an extra row.

Extra row for placing sum of amounts.

thanx a lot i dint know how to add the row but i figured it out.

how to make a common Function That Will take a MSFlexGrid Name and Return sum of all Colomn having data Type Integer Or Double