ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   After Enter in a cell (https://www.excelbanter.com/excel-programming/284573-after-enter-cell.html)

Lars Kofod

After Enter in a cell
 
When you have entered numbers or text in a cell, and pres
enter, the cellpointer move up or down, left or right or
nowhere. How can I find out what it does from VBA. What
property do I look for?

Thank you
Lars Kofod

Don Guillett[_4_]

After Enter in a cell
 
If you record a macro it will only give you the address you went to.
If you want to control where it goes in a macro use OFFSET

range("a1").offset(1,4).select


--
Don Guillett
SalesAid Software

"Lars Kofod" wrote in message
...
When you have entered numbers or text in a cell, and pres
enter, the cellpointer move up or down, left or right or
nowhere. How can I find out what it does from VBA. What
property do I look for?

Thank you
Lars Kofod




Jake Marx[_3_]

After Enter in a cell
 
Hi Lars,

The MoveAfterReturn and MoveAfterReturnDirection properties (of the
Application object) will give you what you're looking for:

Public Function gsMoveAfterReturn() As String
If Application.MoveAfterReturn Then
Select Case Application.MoveAfterReturnDirection
Case xlDown
gsMoveAfterReturn = "Down"
Case xlUp
gsMoveAfterReturn = "Up"
Case xlToLeft
gsMoveAfterReturn = "Left"
Case xlToRight
gsMoveAfterReturn = "Right"
End Select
End If
End Function

--
Regards,

Jake Marx
MS MVP - Excel
www.longhead.com

[please keep replies in the newsgroup - email address unmonitored]


Lars Kofod wrote:
When you have entered numbers or text in a cell, and pres
enter, the cellpointer move up or down, left or right or
nowhere. How can I find out what it does from VBA. What
property do I look for?

Thank you
Lars Kofod




All times are GMT +1. The time now is 11:03 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com