Cursor not to move when pressing the enter key

  • Thread starter Thread starter Alex Martinez
  • Start date Start date
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.
 
Alex,

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

Alok Joshi
 
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.
 
Back
Top