ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   How to program keystrokes other than CTRL+something? (https://www.excelbanter.com/excel-programming/364068-how-program-keystrokes-other-than-ctrl-something.html)

[email protected]

How to program keystrokes other than CTRL+something?
 
I often enter data into a spreadsheet using just the numeric keypad.
Frequently, I need to enter the same value into a number of successive
cells.

I would like to be able to repeat the entry of the same value by means
of a single keystroke. The 'accelerator key' function associated with
macros seems to allow only combinations of CTRL with (I think)
alphanumeric keys.

I have been able to do this by writing a macro that copies the contents
of the previous cell to the current one (using ActiveCell methods), and
specifying this macro as the second argument to an Application.OnKey
statement in a macro that sets up the spreadsheet.

This works fine, but I would really like to use the '+' key on the
numeric keypad to do this. But if I specify "{+}" as the first argument
to the Application.OnKey, it works only when I press Shift and the '+'
key on the top row of the full keypad. If I press the '+' key on the
numeric keypad, it simply puts a '+' into the cell!

Does anyone know of a way to persuade Excel (2000) or VB to do what I
want?



All times are GMT +1. The time now is 02:04 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com