Cursor Movement

F

Froggy2899

Someone asked this question
"How do I ensure that Excel returns the cursor to column A after pressing
enter in column C?"
And this was the answer
"You could start entering data in a row, and use the <Tab> key to move the
focus along the row, across columns.
Then, a hit of the <Enter> key returns the focus to the starting column, one
row beneath the original cell."

How do I fix this if it stops working? I have Excel 03 and I type in cell
A1 then hit tab, type in cell B1 then hit tab and type in cell C1 and hit
enter. I want the cursor to return to A2 when I hit enter. I have always
been able to do this and now all of a sudden I can't.

HELP
 
G

Gary''s Student

After putting this macro in the worksheet code area, the completion of an
entry in column C will take you to column A one row down:

Private Sub Worksheet_Change(ByVal Target As Range)
Set t = Target
Set c = Range("C:C")
If Intersect(t, c) Is Nothing Then Exit Sub
Cells(t.Row + 1, 1).Select
End Sub

You can use the ENTER key, the TAB key, or the ARROW keys.

Because it is worksheet code, it is very easy to install and use:

1. right-click the tab name near the bottom of the window
2. select View Code - this brings up a VBE window
3. paste the stuff in and close the VBE window

If you save the workbook, the macro will be saved with it.

To remove the macro:

1. bring up the VBE windows as above
2. clear the code out
3. close the VBE window

To learn more about macros in general, see:

http://www.mvps.org/dmcritchie/excel/getstarted.htm

To learn more about Event Macros (worksheet code), see:

http://www.mvps.org/dmcritchie/excel/event.htm
 
G

Gord Dibben

Perhaps you have changed direction or unchecked Tools>Options>Edit

"Move selection after enter"

Must be set to "Down" for your Tab and Enter method to work.


Gord Dibben MS Excel MVP
 

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