View Single Post
  #2   Report Post  
Dave Peterson
 
Posts: n/a
Default Pressing Enter Key

Record a macro when you change this setting to right.
Put that code in the workbook_activate event

Record a macro when you change this setting back to down.
Put that code in the workbook_deactivate event.

Both of these events go behind the ThisWorkbook module.

This is what my code looked like:

Option Explicit
Private Sub Workbook_Activate()
Application.MoveAfterReturn = True
Application.MoveAfterReturnDirection = xlToRight
End Sub
Private Sub Workbook_Deactivate()
Application.MoveAfterReturn = True
Application.MoveAfterReturnDirection = xlDown
End Sub

If you're new to macros, you may want to read David McRitchie's intro at:
http://www.mvps.org/dmcritchie/excel/getstarted.htm

Yo wrote:

Hi,

I would like to press the Enter key and have it move Right instead of Down
on one of my excel spreadsheets. I know you can change that option under
tools, but that changes it for every workbook, and I only want that option
on a certain workbook. Is there a way I can make this happen without
changing it everytime I open Excel?

Thanks in advance for your advice.


--

Dave Peterson