PDA

View Full Version : Solved: how to change direction of move after Enter in one sheet



danovkos
06-25-2009, 02:34 AM
Hi all,
pls. is here any possibility how can i change my default behavior (movoment) of cursor after pressing enter?

What i need is change this only for one sheet in one WB and change it from "move to down" to "move to right".

And for all other WB and sheets it will be default "move to down"

How can i do that pls?

what i found with google was only change it for whole wb :(

thx for help

p45cal
06-25-2009, 03:17 AM
in the code module for the sheet concerned:Private Sub Worksheet_Activate()
Application.MoveAfterReturnDirection = xlToRight
End Sub
Private Sub Worksheet_Deactivate()
Application.MoveAfterReturnDirection = xlDown
End Sub
This is not very friendly if the file will be used on other's machines as it leaves this setting as xlDown which may not be their preference.

danovkos
06-25-2009, 04:29 AM
yes it works great...
thank you very much

slamet Harto
06-25-2009, 11:56 PM
How about if I want cursor move to down to the third column
example. current cursor position is in A1, after pressing enter will move to A3.

Thanks!

hardlife
06-27-2009, 04:33 AM
Private Sub Worksheet_Activate()
'Application.MoveAfterReturnDirection = xlToRight
End Sub

Private Sub Worksheet_Deactivate()
Application.MoveAfterReturnDirection = xlDown
End Sub

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
'Cells(ActiveCell.Row, 3).Activate
Cells(3, ActiveCell.Column).Activate
End Sub


Hi Harto, try this,

HTH :hi:

Pavel