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


Edited 3 Years Ago by Jx_Man


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

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

This question has already been answered. Start a new discussion instead.