assim colega
O nome que dei para o MSFlexgrid no exemplo é FlxGd
Option Explicit
Private Sub Form_Load()
Dim x As Integer
With FlxGd
.ColAlignment(-1) = 1
For x = 1 To .Cols - 1
.TextMatrix(0, x) = "Col " + Str(x)
Next
For x = 1 To FlxGd.Rows - 1
.TextMatrix(x, 0) = "Row " + Str(x)
Next
.Row = 1
.Col = 1
.CellBackColor = &HC0FFFF 'Amarelo claro
End With
End Sub
Private Sub FlxGd_EnterCell()
FlxGd.CellBackColor = &HC0FFFF 'Amarelo claro
FlxGd.Tag = ""
End Sub
Private Sub FlxGd_LeaveCell()
FlxGd.CellBackColor = &H80000005
End Sub
Private Sub FlxGd_KeyDown(KeyCode As Integer, Shift As Integer)
Select Case KeyCode
Case 46 '<Del>, apaga celula
FlxGd.Tag = FlxGd
FlxGd = ""
End Select
End Sub
Private Sub FlxGd_KeyPress(KeyAscii As Integer)
Select Case KeyAscii
Case 13 'Tecla ENTER
Advance_Cell 'Avancar para nova cellula
Case 8 'Backspace
If Len(FlxGd) Then
FlxGd = Left$(FlxGd, Len(FlxGd) - 1)
End If
Case 27 'ESC
If FlxGd.Tag > "" Then 'Se todos forem NULL
FlxGd = FlxGd.Tag 'Retorna ao texto original
End If
Case Else
FlxGd = FlxGd + Chr(KeyAscii)
End Select
End Sub
Private Sub FlxGd_Click()
FlxGd.CellBackColor = &H80000005
End Sub
Private Sub FlxGd_MouseDown(Button As Integer, Shift As Integer, x As Single, y As Single)
Dim Row As Integer, Col As Integer
Row = FlxGd.MouseRow
Col = FlxGd.MouseCol
If Button = 2 And (Col = 0 Or Row = 0) Then
FlxGd.Col = IIf(Col = 0, 1, Col)
FlxGd.Row = IIf(Row = 0, 1, Row)
PopupMenu MnuFGridRows
End If
End Sub
Private Sub Advance_Cell() 'Avancar para proxima cellula
With FlxGd
.HighLight = flexHighlightNever
If .Col < .Cols - 1 Then
.Col = .Col + 1
Else
If .Row < .Rows - 1 Then
.Row = .Row + 1 'Desce uma linha
.Col = 1
Else
.Row = 1
.Col = 1
End If
End If
If .CellTop + .CellHeight > .Top + .Height Then
.TopRow = .TopRow + 1
End If
.HighLight = flexHighlightAlways
End With
End Sub
Espero que isto lhe ajude, boa sorte