Hi thaupert and welcome to ExcelForum,
You can trap any keystroke (such as 'K'), but it requires advanced techniques that may become unstable if not used properly. The EnableCancelKey command will enable you to do special processing when the User presses the 'Esc' key. The built in error module will have a value of 'Err.Number = 18'.
It is a best practice to declare all variables. If you misspell a variable in your code, VBA will silently assume it is a Variant variable and go on executing with no clue to you that you have a bug. Go to the VBA development window, click Tools, Options, and check "Require Variable Declaration." This will insert the following line at the top of all new modules:
This option requires all variables to be declared and will give a compiler error for undeclared variables.
Lewis
Bookmarks