hi
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

thanx

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

af5176f21877f429286df1edb1c3361b

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

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.