Private Sub msfG_EnterCell()
colocaText
End Sub
Private Sub txtEditaCelda_Change()
msfG.Text = txtEditaCelda.Text
End Sub
Private Sub txtEditaCelda_KeyUp(KeyCode As Integer, Shift As Integer)
Select Case KeyCode
Case vbKeyUp
If msfG.Row = 1 Then
msfG.Row = msfG.Rows - 1
Else
msfG.Row = msfG.Row - 1
End If
Case vbKeyDown
If msfG.Row = msfG.Rows - 1 Then
msfG.Row = 1
Else
msfG.Row = msfG.Row + 1
End If
Case vbKeyLeft
If txtEditaCelda.SelStart = 0 Then
If msfG.Col = 1 Then
msfG.Col = msfG.Cols - 1
Else
msfG.Col = msfG.Col - 1
End If
End If
Case vbKeyRight
If txtEditaCelda.SelStart = Len(txtEditaCelda.Text) Then
If msfG.Col = msfG.Cols - 1 Then
msfG.Col = 1
Else
msfG.Col = msfG.Col + 1
End If
End If
End Select
End Sub
' Coloca el textBox sobre la celda actual
Private Sub colocaText()
With txtEditaCelda
.Move msfG.CellLeft + msfG.Left, msfG.CellTop + msfG.Top, msfG.CellWidth, msfG.CellHeight
.Visible = True
.ZOrder 0
.Text = msfG.Text
.SetFocus
.SelStart = Len(txtEditaCelda.Text)
End With
End Sub
P.D.: si no sabes adecuarlo a tus necesidades po