Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Onkey Error
Hi!
In trying to reassign the "Del" key to the "Backspace" key, I've tried to program a procedure whenever the user presses "Delete". I've placed the following lines of code within the Workbook_Activate event (which, as usual, resides in the "ThisWorkbook" section): ------------------------------------------- Application.Onkey "{DEL}", "ClearCell" ------------------------------------------- and then wrote a new procedure, still within the "ThisWorkbook" section: ---------------------------- Sub ClearCell() ActiveCell.ClearContents End Sub ---------------------------- However, when I press the Delete key, Excel says that the macro couldn't be found! Could someone please help? Thanks! SuperJas. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Onkey Error
One way:
Put ClearCell in a regular code module. In article , "SuperJas" wrote: Hi! In trying to reassign the "Del" key to the "Backspace" key, I've tried to program a procedure whenever the user presses "Delete". I've placed the following lines of code within the Workbook_Activate event (which, as usual, resides in the "ThisWorkbook" section): ------------------------------------------- Application.Onkey "{DEL}", "ClearCell" ------------------------------------------- and then wrote a new procedure, still within the "ThisWorkbook" section: ---------------------------- Sub ClearCell() ActiveCell.ClearContents End Sub ---------------------------- However, when I press the Delete key, Excel says that the macro couldn't be found! Could someone please help? Thanks! SuperJas. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
OnKey disabled by Excel at times? | Excel Discussion (Misc queries) | |||
onkey method | Excel Discussion (Misc queries) | |||
Onkey vs Macro Short cut key | Excel Discussion (Misc queries) | |||
Onkey | Excel Programming | |||
OnKey for Alt f not overriding standard use of Alt-F | Excel Programming |