-
I have a MSHFlexgrid populated from a textarray loop and i have a total cell on the last row that calculates the above cells for each column. This is again calculated with a textarray statement in order that the focus isnt taken from the selected cell the user has chosen/moved to. I want to change the total cell color to red when a negative value is calculated. Specifying the row and col properties as a loop only takes the focus away. Helllllp
-
After populating the Grid, you can do something like this:
Code:
Dim intCol As Integer
With MSHFlexGrid1
For intCol = 0 To .Cols - 1
If Val(.TextMatrix(.Rows - 1, intCol)) < 0 Then
.Row = .Rows - 1
.Col = intCol
.CellForeColor = vbRed
End If
Next
End With
-
Yes this works but unfortunately the focus is taken away from the current cell after the function has executed. if a user enters a value into row 1 col 2 then moves with the right arrow to row 1 col 3 the function will run but the cell focus is now on row 4 col 32, the bottom right corner of the grid. How do return the focus to the users cell
-
You can memorize the position before you colorize cells and return to that cell after you colorize all cells.
-
Many Thanks, superb service