Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
enter key behavior - by sheet
I know the enter key's next cell advance behavior can be addressed in workbook options, but how would I adjust it on a sheet by sheet basis?
On sheet entry I would like to do two things, record the current enter key configuration and then change it to, for example, advance down columns. On sheet exit, I would like to return the key to its original state. Thank you |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
enter key behavior - by sheet
Copy these two events to a sheet module.
Private Sub Worksheet_Activate() Application.MoveAfterReturnDirection = xlToRight End Sub Private Sub Worksheet_Deactivate() Application.MoveAfterReturnDirection = xlDown End Sub Gord On Wed, 9 Jul 2014 10:40:15 -0700 (PDT), wrote: I know the enter key's next cell advance behavior can be addressed in workbook options, but how would I adjust it on a sheet by sheet basis? On sheet entry I would like to do two things, record the current enter key configuration and then change it to, for example, advance down columns. On sheet exit, I would like to return the key to its original state. Thank you |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
enter key behavior - by sheet
Oops! Where the sheet-specific MoveAfterEnter needs to be default,
change Workbook_SheetActivate as follows... Private Sub Workbook_SheetActivate(ByVal Sh As Object) Dim sDirMove$ On Error Resume Next '//if name doesn't exist sDirMove = Mid(Sh.Names("uiDirMove").RefersTo, 2) 'Restore default if no change needed If sDirMove < "" Then SetEnterKeyBehavior sDirMove _ Else Call Workbook_Deactivate End Sub Also, note that I changed the var sDir to sDirMove for naming convention consistency! -- - Garry Free Usenet access at http://www.eternal-september.org Classic VB Users Regroup! comp.lang.basic.visual.misc microsoft.public.vb.general.discussion |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
enter key behavior - by sheet
Gord Dibben
GS thank you all. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Enter key functions differently after different macro behavior | Excel Programming | |||
Problem managing Enter Key behavior in a userform | Excel Programming | |||
Changing Behavior of the <Enter Key? | Excel Discussion (Misc queries) | |||
modify the behavior of the enter key? | Excel Programming | |||
Enter Key behavior with Userforms | Excel Programming |