Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 28
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 983
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 28
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 983
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I change the direction of the cell when I press enter jonathan New Users to Excel 1 January 8th 09 03:25 PM
Pressing enter to change cell Stuster Excel Discussion (Misc queries) 2 December 11th 07 04:08 AM
change autofilter behaviour? willyhoops.com Excel Discussion (Misc queries) 0 February 26th 07 11:00 AM
Enter 1 in a cell, excel change to 0.001, WHY? Jag Excel Worksheet Functions 1 February 3rd 06 03:38 PM
Cell Value Override saschamps9903 Excel Discussion (Misc queries) 0 January 21st 05 09:53 PM


All times are GMT +1. The time now is 10:36 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"