Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 99
Default To disable pressing of Enter key on a sheet

I have a worksheet
I want to disable pressing of Enter in the Sheet (ie. after pressing
Enter Key the selection of the cell should not go to the next cell)
and it should run a macro.
I have written the macro. Now, I want to run that macro when the User
presses the Enter Key.
It is similar to Keypress event in forms. I worked out and found that
there is code to disable the right click and to run other macro on
right click but i could not find any way to disable the enter key.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default To disable pressing of Enter key on a sheet

Ensure "Move selection after enter" is not enabled in Options

You can trap when a user changes a cell entry, whether done with Enter or
any other means. Right-click the sheet tab, View code. That will take you to
the sheet module

In the top middle drop down select Worksheet
In the top right dropdown select Change

That will write the event stub for the Worksheet_Change event. Te argument
"Target" will refer to the cells that have just changed.

If you don't have much to do write your code in the event stub, otherwise
you could pass Target to a procedure in a normal module.

Regards,
Peter T

"Subodh" wrote in message
...
I have a worksheet
I want to disable pressing of Enter in the Sheet (ie. after pressing
Enter Key the selection of the cell should not go to the next cell)
and it should run a macro.
I have written the macro. Now, I want to run that macro when the User
presses the Enter Key.
It is similar to Keypress event in forms. I worked out and found that
there is code to disable the right click and to run other macro on
right click but i could not find any way to disable the enter key.



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Pressing enter to change cell Stuster Excel Discussion (Misc queries) 2 December 11th 07 04:08 AM
WYA Converts to WAY after pressing enter ket Roger Cookson Excel Discussion (Misc queries) 3 December 16th 05 05:24 PM
Pressing Enter Key Yo Setting up and Configuration of Excel 4 October 28th 05 10:59 PM
Cursor not to move when pressing the enter key Alex Martinez Excel Programming 2 May 12th 05 07:49 PM
How do I follow a hyperlink by just pressing "enter"? Bob Small Excel Discussion (Misc queries) 1 April 5th 05 02:54 PM


All times are GMT +1. The time now is 10:40 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"