Onkey Error

S

SuperJas

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top