Dim intRow As Integer
Dim intCol As Integer
Dim strColumn2 As String
Dim strColumn3 As String
For intRow = 0 To MSFlexGrid1.Rows - 1
'// Set the row
MSFlexGrid1.Row = intRow
'// Check if the row is 6?
If intRow = 6 Then
'// Capture column 2 content
MSFlexGrid1.Col = 2
strColumn2 = MSFlexGrid1.Text
'// Capture column 3 content
MSFlexGrid1.Col = 3
strColumn3 = MSFlexGrid1.Text
If strColumn2 = "10" And strColumn3 = "10" Then
'// Loop through each column and change the backcolor
For intCol = 0 to MSFlexGrid1.Cols - 1
MSFlexGrid1.Col = intCol
MSFlexGrid1.CellBackColor = vbGray '// Or any color
Next
End If
End If
Next
|