MoveAfterReturn is tricking me.
G'day there Bernie,
Don't use the Worksheet_Change but do use the Workbook_SheetSelectionChange
event to check which sheet and which column have been selected, and change
as needed.
Put this in Thisworkbook's codemodule:
Dim myDir As Variant
Private Sub Workbook_SheetSelectionChange(ByVal Sh As Object, ByVal Target
As Range)
On Error Resume Next
If Sh.Name < "Sheet name where this should happen" Then Exit Sub
If Target.Column = 1 Then
myDir = Application.MoveAfterReturnDirection
Application.MoveAfterReturnDirection = xlToRight
Else
Application.MoveAfterReturnDirection = myDir
End If
End Sub
Thanks for that Bernie. That's an approach I'd not considered at
all. Not only that, but it allows different directions to move in
different locations. Very handy indeed =)
Tom has also offered a reply with a different way of working it.
Rest assured, I'll be having a bash at both of them to see which one I
can adapt to this and other problems that arise.
Thanks once again
Ken McLennan
Qld, Australia
|