How to program keystrokes other than CTRL+something?

J

jmgross

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?
 

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