Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 104
Default Change enter key direction based on range

Oh Wise Ones,
I jump back in forth between several workbooks
throughout the day. Almost all of them I need the Enter key to move to the
right when pressed. I know how to manually set the direction, but for the few
ranges I need it to move down, can I have it programmatically switch
directions only in that particular range?

Many thanks,
Mike
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default Change enter key direction based on range

You might be able to adapt this into a Worksheet_Change with the Target range
being the control factor. I didn't test it.


Set MyRange = ActiveSheet.Range("C5:C25")
If Intersect(MyRange, Target) Then
Application.MoveAfterReturn = True
Application.MoveAfterReturnDirection = xlDown
Else
Application.MoveAfterReturnDirection = xlToRight
End If


"Mike K" wrote:

Oh Wise Ones,
I jump back in forth between several workbooks
throughout the day. Almost all of them I need the Enter key to move to the
right when pressed. I know how to manually set the direction, but for the few
ranges I need it to move down, can I have it programmatically switch
directions only in that particular range?

Many thanks,
Mike

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 104
Default Change enter key direction based on range

Thanks JLG,
Didn't work when implemented as below:

Private Sub Worksheet_Change(ByVal Target As Range)
Set MyRange = ActiveSheet.Range("J3:L12")
If Intersect(MyRange, Target) Then
Application.MoveAfterReturn = True
Application.MoveAfterReturnDirection = xlDown
Else
Application.MoveAfterReturnDirection = xlToRight
End If
End Sub

Still moves to the right.

This is what I figured the code would look like, but I'm not strong enough
in vba to do it myself.

Mike

"JLGWhiz" wrote:

You might be able to adapt this into a Worksheet_Change with the Target range
being the control factor. I didn't test it.


Set MyRange = ActiveSheet.Range("C5:C25")
If Intersect(MyRange, Target) Then
Application.MoveAfterReturn = True
Application.MoveAfterReturnDirection = xlDown
Else
Application.MoveAfterReturnDirection = xlToRight
End If


"Mike K" wrote:

Oh Wise Ones,
I jump back in forth between several workbooks
throughout the day. Almost all of them I need the Enter key to move to the
right when pressed. I know how to manually set the direction, but for the few
ranges I need it to move down, can I have it programmatically switch
directions only in that particular range?

Many thanks,
Mike

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 to change the direction of the enter key to go horizontal BManske Excel Worksheet Functions 5 April 9th 15 06:34 PM
change direction when pressing enter RickMoore Excel Discussion (Misc queries) 7 August 11th 09 04:31 PM
How do I change the direction when pressing ENTER? (dn, rt, etc.) CGN Bear Excel Worksheet Functions 3 July 15th 09 06:29 PM
change direction when hitting enter key Using Excel in Conifer Excel Discussion (Misc queries) 1 March 5th 09 09:13 PM
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


All times are GMT +1. The time now is 05:50 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"