Automatic down cell after data entry

B

batti03

Is it possible to have excel go to the next cell automatically after a
entry to a cell. ie. input a number 1,2,3,4, or 5, and automaticall
the next cell would become active without having to hit the enter o
down arrow key? :confused
 
R

Ron de Bruin

Hi batti03

Excel is smart but it don't know when you are ready.
Maybe you enter a 1 digit number and maybe a 10 digit number

You have to confirm with enter or the arrow key
 
D

Dave Peterson

Only 1-5???

One way is to build a tiny userform with just a textbox on it.

Add this code to the userform module:
Option Explicit
Private Sub TextBox1_KeyPress(ByVal KeyAscii As MSForms.ReturnInteger)

Select Case KeyAscii
Case 49 To 53 'Numbers 1-5---Case 48 To 57 for digits 0-9
ActiveCell.Value = Chr(KeyAscii)
ActiveCell.Offset(1, 0).Activate
End Select
KeyAscii = 0
TextBox1.Value = ""

End Sub

Then add this to a general module to show the form:

Option Explicit
Sub testme02()
UserForm1.Show
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
 
Top