Cursor not to move when pressing the enter key

A

Alex Martinez

Hi

I am making a form and I want the user to input a number in a cell (e.g.
A2) and press enter, but I don't want the cursor move into the next cell.
All I want is the cursor to stay in A2. Any suggestion or help will be
appreciated. Thank you.
 
G

Guest

Alex,

Go to Tools, Options, Edit and uncheck the box for "Move Selection After
Enter"

Alok Joshi
 
G

Guest

In a userform if I want to control entry and advancement based on entry I
hide or expose labels and textboxs as needed.
Private Sub UserForm_Activate()
Label14.Visible = False
TextBox14.Visible = False
then if something I want is entered into textbox1 then I expose the next
operation
Private Sub TextBox1_Exit(ByVal Cancel As MSForms.ReturnBoolean)
If Val(TextBox1) > 1 Then
Label14.Visible = True
TextBox14.Visible = True
end if
If enter is pressed the focus will not advance to a hidden object.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top