Hello
I have about 100 rows in a grid having Names, I want to search in MS FLEXGRID like THOMAS which is the 68th row, How can i do this ? Please help me
Printable View
Hello
I have about 100 rows in a grid having Names, I want to search in MS FLEXGRID like THOMAS which is the 68th row, How can i do this ? Please help me
VB Code:
Dim lngRow as Long Dim blnFound as Boolean blnFound = False For lngRow = 0 To MSFlexGrid.Rows - 1 If MSFlexGrid.TextMatrix(lngRow, 0) = "THOMAS" Then 'change 0 to the correct column # blnFound = True Exit For End If Next If blnFound Then debug.print "Found on Row " & lngRow Else Debug.print "Not Found" End If
Thanks.
But how to automatically select that row ?
VB Code:
Dim lngRow as Long Dim blnFound as Boolean blnFound = False For lngRow = 0 To MSFlexGrid.Rows - 1 If MSFlexGrid.TextMatrix(lngRow, 0) = "THOMAS" Then 'change 0 to the correct column # blnFound = True Exit For End If Next If blnFound Then MSFlexGrid.Row = lngRow 'sets the current Row MSFlexGrid.TopRow = lngRow 'moves the row into view Else Debug.print "Not Found" End If
Thaks brucevde , I solved