Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
how to change (override) enter key behaviour in a cell
thanx to all who replied to my last post regarding enter key behaviour.
but problem is still not solved. i think i should have been more clear. the moveAfterReturn method is only boolean type and it tells if the enter key will be effective or not, that is, if moveAfterReturn = true (by default),then pressing enter will take the user to next cell and if moveAfterReturn = false then pressing enter will not have any effect at all. moveAfterReturnDirection tells only direction in which cell selection will move. my problem is that i want to go to the next line in the SAME cell when i press enter and not to the next cell. i can go to next line in same cell by alt+enter (now also) but i have a specific requirement in which i have to over ride enter key so that when user presses enter key , the cursor remains in the same cell but on the next line. TIA regards |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
how to change (override) enter key behaviour in a cell
Look up the OnKey method in VBA help. I think that is what you want...
HTH "helpwithXL" wrote: thanx to all who replied to my last post regarding enter key behaviour. but problem is still not solved. i think i should have been more clear. the moveAfterReturn method is only boolean type and it tells if the enter key will be effective or not, that is, if moveAfterReturn = true (by default),then pressing enter will take the user to next cell and if moveAfterReturn = false then pressing enter will not have any effect at all. moveAfterReturnDirection tells only direction in which cell selection will move. my problem is that i want to go to the next line in the SAME cell when i press enter and not to the next cell. i can go to next line in same cell by alt+enter (now also) but i have a specific requirement in which i have to over ride enter key so that when user presses enter key , the cursor remains in the same cell but on the next line. TIA regards |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
how to change (override) enter key behaviour in a cell
thanx Jim,
this is exactly what i wanted but can u also tell how to make the cursor go down when i'm editing the cell. so with onKey i can assign a new sub whenever enter key is pressed but how do i write this syntactically in the sub i assigned, that i want the cursor to go down and have a line feed. i tried vbcrlf but it does not work. TIA regards |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
how to change (override) enter key behaviour in a cell
As a guess without trying it you want to use SendKey to send the Alt Enter
keystroke HTH "helpwithXL" wrote: thanx Jim, this is exactly what i wanted but can u also tell how to make the cursor go down when i'm editing the cell. so with onKey i can assign a new sub whenever enter key is pressed but how do i write this syntactically in the sub i assigned, that i want the cursor to go down and have a line feed. i tried vbcrlf but it does not work. TIA regards |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How do I change the direction of the cell when I press enter | New Users to Excel | |||
Pressing enter to change cell | Excel Discussion (Misc queries) | |||
change autofilter behaviour? | Excel Discussion (Misc queries) | |||
Enter 1 in a cell, excel change to 0.001, WHY? | Excel Worksheet Functions | |||
Cell Value Override | Excel Discussion (Misc queries) |