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.
|