Worksheet change: move to next cell

  • Thread starter Thread starter SFC Traver
  • Start date Start date
S

SFC Traver

I have browsed around the group and didn't find anything specific to help me
with a macro. I am weak on VBA. What I need is when a single digit value is
entered in a cell, to have it move to the next cell. So, when a user types in
"4" in B2, then it should move to C2.

I also need it to move to the next row once it a value is entered in Y2. So
when a user types in "3" in Y2, it moves to B3 and repeats the code above.

Can it be done? I've done the data validation to restrict the cells, just
need specifics on how to do the macro.
Thanks!
 
Right click sheet tab>view code>insert this>SAVE workbook

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column < 2 Or Target.Column > 25 Then Exit Sub
If Target.Column = 25 Then
Target.Offset(1, -23).Select
Else
Target.Offset(, 1).Select
End If
End Sub
 
Thanks, Don. It works, but I have to either hit the enter key or click the
mouse to move the cell. Is there a way to do it automatically once a single
digit is entered into the cell?

I'm trying to let the number of keystrokes...
 
How do you enter something into a cell withOUT touching the enter key. You
could always do this manually by touching the right arrow key instead of the
enter key.
 

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