I have flexgrid here.
I want the system to substract maximum value and minimum value for every row in flexgrid.
And the result will be displayed in column 'Julat'(pls see the attachment)
My problem here is, the value for the column is 0(for every row).
I cant figure out why is like that.
Pls help.
Thank U in advance.
Snippet code as below :
VB Code:
Dim row As Long Dim column As Long Dim Max As Long Dim Min As Long With MSFlexGrid7 For row = 1 To .Rows - 1 Max = Val(.TextMatrix(row, 2)) Min = Val(.TextMatrix(row, 2)) 'loop only for column 2 to column 5 For column = 2 To .Cols = 5 If Min > Val(.TextMatrix(row, column)) Then Min = Val(.TextMatrix(row, column)) End If If Max < Val(.TextMatrix(row, column)) Then Max = Val(.TextMatrix(row, column)) End If Next .TextMatrix(row, 7) = Val(Max - Min) Next End With




Reply With Quote