Primero dibuja un MSflexGrid en un formulario, luego, sobre el MSFlexGrid conlo un cuadro de texto y colocas su propiedad BorderStyle = 0
Sub msflexgridedit(MSFlexGrid As Control, edt As Control, keyascii As Integer)
Select Case keyascii
Case 0 To 32
edt = MSFlexGrid
edt.SelStart = 1000
Case Else
edt = Chr(keyascii)
edt.SelStart = 1
End Select
edt.Move MSFlexGrid.CellLeft, MSFlexGrid.CellTop, _
MSFlexGrid.CellWidth, MSFlexGrid.CellHeight
edt.Visible = True
edt.SetFocus
End Sub
Private Sub fg2_DblClick()
msflexgridedit fg2, txtedit, 32
End Sub
Private Sub fg2_KeyPress(keyascii As Integer)
msflexgridedit fg2, txtedit, keyascii
End Sub
Function fgi(r As Integer, c As Integer) As Integer
fgi = c + fg2.Cols * r
End Function
Private Sub txtedit_KeyDown(KeyCode As Integer, Shift As Integer)
EditKeyCode fg2, txtedit, KeyCode, Shift
End Sub
Private Sub txtedit_KeyPress(keyascii As Integer)
Dim linea As Integer
If keyascii = 13 Then
keyascii = 0
If fg2.Col < fg2.Cols - 1 Then
fg2.Col = fg2.Col + 1
Else:
fg2.Col = 2
If fg2.Row < fg2.Rows - 1 Then
fg2.Row = fg2.Row + 1
Else:
fg2.Rows = fg2.Rows + 1
linea = fg2.Rows - 1
fg2.TextMatrix(linea, 0) = Format$(linea, "00")
fg2.Row = fg2.Row + 1
contador = contador + 1
fg2.TextMatrix(linea, 1) = Format$(contador, "00")