Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Changing direction of cursor after hitting enter - toggling with toolbar macro??
After all these years of using Excel, decided that I finally need a
solution to this bit of annoyance <g, although most of the time after hitting Enter, I need the cursor to move to the right (esp. when entering text), I find that too many times, I come across jobs where I need the cursor to move down after hitting Enter. Anyone who really works with inputting data in Excel, knows exactly what I mean. I've done the manual workaround each time to get around this, I'll manually change the movement via the Options. Was hoping for a button that acts like a toggle. When raised, the movement goes to the right; when depressed, the movement will be down. I can picture the icon to draw, too. But is there VB coding to do the actual changing? or perhaps there is an option in the commands for a toolbar option that already exists to do this (?). Thanks. Any help appreciated. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Changing direction of cursor after hitting enter - toggling with toolbar macro??
One way:
Public Sub ToggleEnterDirection() With Application If .MoveAfterReturnDirection = xlToRight Then .MoveAfterReturnDirection = xlDown Else .MoveAfterReturnDirection = xlToRight End If End With End Sub In article , StargateFan wrote: After all these years of using Excel, decided that I finally need a solution to this bit of annoyance <g, although most of the time after hitting Enter, I need the cursor to move to the right (esp. when entering text), I find that too many times, I come across jobs where I need the cursor to move down after hitting Enter. Anyone who really works with inputting data in Excel, knows exactly what I mean. I've done the manual workaround each time to get around this, I'll manually change the movement via the Options. Was hoping for a button that acts like a toggle. When raised, the movement goes to the right; when depressed, the movement will be down. I can picture the icon to draw, too. But is there VB coding to do the actual changing? or perhaps there is an option in the commands for a toolbar option that already exists to do this (?). Thanks. Any help appreciated. |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Changing direction of cursor after hitting enter - toggling withtoolbar macro??
Maybe something like:
Option Explicit Sub testme() Dim iCtr As Long Dim myDirections As Variant Dim myStrings As Variant myDirections = Array(xlDown, xlUp, xlToLeft, xlToRight, xlDown) myStrings = Array("Down", "Up", "Left", "Right", "Down") For iCtr = LBound(myDirections) To UBound(myDirections) If Application.MoveAfterReturnDirection = myDirections(iCtr) Then Application.MoveAfterReturnDirection = myDirections(iCtr + 1) MsgBox "changed to: " & myStrings(iCtr + 1) Exit For End If Next iCtr End Sub StargateFan wrote: After all these years of using Excel, decided that I finally need a solution to this bit of annoyance <g, although most of the time after hitting Enter, I need the cursor to move to the right (esp. when entering text), I find that too many times, I come across jobs where I need the cursor to move down after hitting Enter. Anyone who really works with inputting data in Excel, knows exactly what I mean. I've done the manual workaround each time to get around this, I'll manually change the movement via the Options. Was hoping for a button that acts like a toggle. When raised, the movement goes to the right; when depressed, the movement will be down. I can picture the icon to draw, too. But is there VB coding to do the actual changing? or perhaps there is an option in the commands for a toolbar option that already exists to do this (?). Thanks. Any help appreciated. -- Dave Peterson |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Changing direction of cursor after hitting enter - toggling with toolbar macro??
Wow, that was super fast! <g
Thanks, will give this a try. Cheers! On Fri, 28 Jan 2005 20:42:25 -0600, Dave Peterson wrote: Maybe something like: Option Explicit Sub testme() Dim iCtr As Long Dim myDirections As Variant Dim myStrings As Variant myDirections = Array(xlDown, xlUp, xlToLeft, xlToRight, xlDown) myStrings = Array("Down", "Up", "Left", "Right", "Down") For iCtr = LBound(myDirections) To UBound(myDirections) If Application.MoveAfterReturnDirection = myDirections(iCtr) Then Application.MoveAfterReturnDirection = myDirections(iCtr + 1) MsgBox "changed to: " & myStrings(iCtr + 1) Exit For End If Next iCtr End Sub StargateFan wrote: After all these years of using Excel, decided that I finally need a solution to this bit of annoyance <g, although most of the time after hitting Enter, I need the cursor to move to the right (esp. when entering text), I find that too many times, I come across jobs where I need the cursor to move down after hitting Enter. Anyone who really works with inputting data in Excel, knows exactly what I mean. I've done the manual workaround each time to get around this, I'll manually change the movement via the Options. Was hoping for a button that acts like a toggle. When raised, the movement goes to the right; when depressed, the movement will be down. I can picture the icon to draw, too. But is there VB coding to do the actual changing? or perhaps there is an option in the commands for a toolbar option that already exists to do this (?). Thanks. Any help appreciated. |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Changing direction of cursor after hitting enter - toggling with toolbar macro??
On Fri, 28 Jan 2005 19:40:09 -0700, JE McGimpsey
wrote: One way: Public Sub ToggleEnterDirection() With Application If .MoveAfterReturnDirection = xlToRight Then .MoveAfterReturnDirection = xlDown Else .MoveAfterReturnDirection = xlToRight End If End With End Sub Just saw your message, sorry for delay in responding. It came in late (ah, servers <g!). I'll try this, thank you! In article , StargateFan wrote: After all these years of using Excel, decided that I finally need a solution to this bit of annoyance <g, although most of the time after hitting Enter, I need the cursor to move to the right (esp. when entering text), I find that too many times, I come across jobs where I need the cursor to move down after hitting Enter. Anyone who really works with inputting data in Excel, knows exactly what I mean. I've done the manual workaround each time to get around this, I'll manually change the movement via the Options. Was hoping for a button that acts like a toggle. When raised, the movement goes to the right; when depressed, the movement will be down. I can picture the icon to draw, too. But is there VB coding to do the actual changing? or perhaps there is an option in the commands for a toolbar option that already exists to do this (?). Thanks. Any help appreciated. |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
Changing direction of cursor after hitting enter - toggling with toolbar macro??
On Fri, 28 Jan 2005 19:40:09 -0700, JE McGimpsey
wrote: One way: Public Sub ToggleEnterDirection() With Application If .MoveAfterReturnDirection = xlToRight Then .MoveAfterReturnDirection = xlDown Else .MoveAfterReturnDirection = xlToRight End If End With End Sub EXCELLENT! Finally got around to creating icon and assigning macro (working on 2 or 3 other Excel projects). But this is going to be a big help as I'm using Excel heavily now and sometimes data entry goes down and sometimes one enters data along rows. Thanks so much! In article , StargateFan wrote: After all these years of using Excel, decided that I finally need a solution to this bit of annoyance <g, although most of the time after hitting Enter, I need the cursor to move to the right (esp. when entering text), I find that too many times, I come across jobs where I need the cursor to move down after hitting Enter. Anyone who really works with inputting data in Excel, knows exactly what I mean. I've done the manual workaround each time to get around this, I'll manually change the movement via the Options. Was hoping for a button that acts like a toggle. When raised, the movement goes to the right; when depressed, the movement will be down. I can picture the icon to draw, too. But is there VB coding to do the actual changing? or perhaps there is an option in the commands for a toolbar option that already exists to do this (?). Thanks. Any help appreciated. |
#7
Posted to microsoft.public.excel.programming
|
|||
|
|||
Changing direction of cursor after hitting enter - toggling with toolbar macro??
For those that would prefer a keyboard solution to a VBA/icon one: The
Enter key is not the only key that can be used to enter something into a cell. The 4 arrow keys can also be used as "Enter" keys. For example, I have my Enter key set to stay in the current cell upon enter. For times I need to enter something into a cell and upon enter have the cell pointer go to the cell to the right, I hit the right arrow INSTEAD of the Enter key. This enters whatever I've typed into the current cell and immediately goes to the cell to the right - all without hitting the Enter key. Likewise, when I want the cellpointer to go to the cell below upon enter, I hit the down arrow instead of the enter key. Whatever I've typed is then entered into the current cell, and the cellpointer immediately goes to the cell below - again without hitting the Enter key. This obviously also works with the up and left arrows as well as any other movement keys, like Page Up, Page Down, Ctrl+Home, etc. (though probably less practical). |
#8
Posted to microsoft.public.excel.programming
|
|||
|
|||
Changing direction of cursor after hitting enter - toggling with toolbar macro??
To elaborate on your mesage, the Tab key can also be used to move onto
another cell. This is particularly useful when you have locked cells, as the focus jumps to the next available unlocked cell. Ian "Paul D. Simon" wrote in message oups.com... For those that would prefer a keyboard solution to a VBA/icon one: The Enter key is not the only key that can be used to enter something into a cell. The 4 arrow keys can also be used as "Enter" keys. For example, I have my Enter key set to stay in the current cell upon enter. For times I need to enter something into a cell and upon enter have the cell pointer go to the cell to the right, I hit the right arrow INSTEAD of the Enter key. This enters whatever I've typed into the current cell and immediately goes to the cell to the right - all without hitting the Enter key. Likewise, when I want the cellpointer to go to the cell below upon enter, I hit the down arrow instead of the enter key. Whatever I've typed is then entered into the current cell, and the cellpointer immediately goes to the cell below - again without hitting the Enter key. This obviously also works with the up and left arrows as well as any other movement keys, like Page Up, Page Down, Ctrl+Home, etc. (though probably less practical). |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How do I disable the cursor movement after hitting enter in a cell | Excel Discussion (Misc queries) | |||
How do I prevent cursor advancement after hitting enter? | Excel Discussion (Misc queries) | |||
change direction when hitting enter key | Excel Discussion (Misc queries) | |||
Hitting Enter to Move Cursor to the Next Entry Cell | Excel Worksheet Functions | |||
Cursor not to move when hitting the enter key | Excel Worksheet Functions |