Hit Return, Back to B1, etc

R

Rentapen

Hello, again my search syntax of words are failing me. I just wish my users
to enter data to row/column A1 to A10 hit return/tab and the cursor moves to
B1 to start over. I have lists of names starting at A12/B.../C.. etc. which
is input in earlier row/columns. I also have hidden list farther over. Its
seems simple, I just need a search word to start.

Just Wandering
rentapen
 
J

Jerry W. Lewis

- Tools|Macro|Visual Basic Editor
- Toward the upper left you will see the Project Explorer (default label
is "Project - VBA Project"). In the Project Explorer locate your
workbook, and the appropriate sheet under the workbook. Double click on
the sheet.
- On the worksheet code page that appeared when you doubled clicked,
insert the following code

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Row = 11 Then
Cells(1, Target.Column + 1).Select
End If
End Sub

On that sheet, whenever a cell in row 11 would be selected (as when the
user presses enter from row 10), then the first row in the next column
will be selected instead.

Jerry
 
R

Rentapen

Thanks Jerry, I knew I was getting close, but I screwed up. My data is going
across columns, A4 to L4, then back to A5 to L5. I tried changing the
target. but it doen't seem to work. Also when I go to save it wants to
assign a macro name in a new module?
thanks again, I'll search the sel-change help.

just wandering
rentapen
 
R

Rentapen

Update: After awhile I came up with this.


Private Sub Worksheet_SelectionChange(ByVal Target As Range)
With ActiveWindow
If Not Application.Intersect(Target, Range("m4:m300")) Is Nothing Then
Cells(ActiveCell.Row, 1).Select

End If
End With
End Sub

It goes to the end of my row and returns. But to the start of the same row.
Thats ok but a shift down one row would be nice.

just wandering
rent
 

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

Top