Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Pressing enter to change cell | Excel Discussion (Misc queries) | |||
WYA Converts to WAY after pressing enter ket | Excel Discussion (Misc queries) | |||
Pressing Enter Key | Setting up and Configuration of Excel | |||
Cursor not to move when pressing the enter key | Excel Programming | |||
How do I follow a hyperlink by just pressing "enter"? | Excel Discussion (Misc queries) |