ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Worksheet change: move to next cell (https://www.excelbanter.com/excel-programming/404015-worksheet-change-move-next-cell.html)

SFC Traver

Worksheet change: move to next cell
 
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!

Don Guillett

Worksheet change: move to next cell
 
Right click sheet tabview codeinsert thisSAVE 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

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"SFC Traver" wrote in message
...
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!



SFC Traver

Worksheet change: move to next cell
 
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...

"Don Guillett" wrote:

Right click sheet tabview codeinsert thisSAVE 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

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"SFC Traver" wrote in message
...
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!




Don Guillett

Worksheet change: move to next cell
 

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.

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"SFC Traver" wrote in message
...
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...

"Don Guillett" wrote:

Right click sheet tabview codeinsert thisSAVE 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

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"SFC Traver" wrote in message
...
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!






All times are GMT +1. The time now is 07:04 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com