View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Flemming[_2_] Flemming[_2_] is offline
external usenet poster
 
Posts: 26
Default Excel text box VBA

Hi,

This works when you enter your text and pres ESC

Private Sub TextBox1_KeyPress(ByVal KeyAscii As MSForms.ReturnInteger)
If KeyAscii.Value = vbKeyEscape Then
Range("A1").Select
End If
End Sub

Cheers,
Flemming


"R Ormerod" wrote in message
...
I've entered a text box into my worksheet from the Control Toolbox
toolbar.

When entering text into the box, how can I get the cursor to return to a
cell in the worksheet after entry has been completed?

I tried the following:

Private Sub TextBox1_Change()

Range("A1").Select

End Sub

But the cursor moved to cell A1 as soon as I started typing text in the
box.

Regards

--
R Ormerod