VBA MoveAfterReturnDirection state

craigexcel

Active Member
Joined
Jun 28, 2006
Messages
295
Office Version
  1. 2016
Platform
  1. Windows
I have searched this forum for "MoveAfterReturnDirection", but didn't see any posts about the current state of the move direction.
The workbook has a number of macros that will run based on entries in specific Columns. As a result, when anyone uses the workbook, I want the 'direction' setting to be 'turned off', via VBA, so the current Row can be captured acurately and saved in a variable. While I can do that easily enough, I want to be able to restore the user's previous setting to what it was before they opened the workbook, in case the user has a specific direction already set that is used as their default.

So, my question is, how do you capture the current state of MoveAfterReturnDirection?

I did try, via some ad hoc VBA code, setting the direction to each of the 4 different ways, and then had the 'result'(?) display via MsgBox. Each direction returned -4161.

I'm using Office 365 (@ work).
 

Excel Facts

Excel Wisdom
Using a mouse in Excel is the work equivalent of wearing a lanyard when you first get to college
Interesting. With my Excel 2010 using
VBA Code:
? application.MoveAfterReturnDirection
in the immediate window gives these
-4159 for left
-4162 for up
-4161 for right
-4121 for down
 
Upvote 0
Solution
With my 365 I get

? application.MoveAfterReturnDirection
-4121
? application.MoveAfterReturnDirection
-4159
? application.MoveAfterReturnDirection
-4162
? application.MoveAfterReturnDirection
-4161
 
Upvote 0
Thanks for both replies. There must have been something in the test code I was using that was slightly off. I appreciate your feedback.
 
Upvote 0

Forum statistics

Threads
1,215,077
Messages
6,122,995
Members
449,094
Latest member
masterms

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top