If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > PC based Database Applications > Microsoft Excel > VBA code for disable "Move selection after Enter"

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 06-04-04, 11:19
SR22Mike SR22Mike is offline
Registered User
 
Join Date: Mar 2004
Location: Minnesota, USA, Earth
Posts: 65
VBA code for disable "Move selection after Enter"

Hi,

I have a feeling that this is really easy, but I'm not sure exactly how to proceed.

For a single Excel file, I would like to disable "Move Selection After Enter" (see Tools>Options>Edit tab). However, I want this to be in effect for this one file only, and I would like all other open Excel files to be unaffected.

Is there a way to do this?

Thanks!
-Mike
Reply With Quote
  #2 (permalink)  
Old 06-07-04, 10:29
DavidCoutts DavidCoutts is offline
Registered User
 
Join Date: Jan 2004
Location: Aberdeen, Scotland
Posts: 1,067
Hi Mike

If you put the code

Application.MoveAfterReturn = False

Into the Workbook_Open Event and the Workbook_Activate Event
And then put

Application.MoveAfterReturn = True

Into the Workbook_BeforeClose and Workbook_Deactivate Events
This should let you restrict the behaviour to the one workbook

HTH
David
Reply With Quote
  #3 (permalink)  
Old 06-08-04, 14:52
SR22Mike SR22Mike is offline
Registered User
 
Join Date: Mar 2004
Location: Minnesota, USA, Earth
Posts: 65
Thanks!

Thanks! It works great!
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On