Ease of Number Entry

  • Thread starter Thread starter paradox80
  • Start date Start date
P

paradox80

I have a spreadsheet that requires the entry of 567 answers to
assessment items designated by "True" (1) or "False" (2). I have cells
A1-A567 as the cells where this information is entered. It is tedious
to have to hit "enter" after each 1 or 2 is typed.

What do I need to do so as soon as I enter a "1" or a "2" in cell
A1-566, the cursor automatically moves down one cell without the user
hitting enter?

Thanks in advance, this board is amazing and I appreciate everyone's
expertise.
 
I would turn
tools|options|edit tab|move selection after enter
to down

Then turn number lock on and use the numeric keypad to type the 1's and 2's.

Hitting the enter key on the numeric keypad doesn't seem too bad to me.

Another alternative is to create a tiny userform that just looks for a 1 or a 2.

Put a single textbox on it (use the X button to close the userform).

Put this code in a General module:

Option Explicit
Sub testme01()
Cells(ActiveCell.Row, 1).Activate
UserForm1.Show
End Sub

Add this code to the userform module:

Option Explicit
Private Sub TextBox1_KeyPress(ByVal KeyAscii As MSForms.ReturnInteger)

Select Case KeyAscii
Case 49 To 50 '48-57 are the Numbers 0-9
With ActiveCell
.Value = Chr(KeyAscii)
.Offset(1, 0).Activate
End With
End Select
KeyAscii = 0
TextBox1.Value = ""

End Sub

If you're new to macros, you may want to read David McRitchie's intro at:
http://www.mvps.org/dmcritchie/excel/getstarted.htm

Debra Dalgleish has some getstarted instructions for userforms at:
http://contextures.com/xlUserForm01.html
 

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

Back
Top