PDA

View Full Version : Macro assigned keys



excel2006
03-08-2012, 08:35 AM
Hi

I have the following issue with Excel:

I originally assigned a macro with the following command.

Application.OnKey "^m"

However, I changed it to the following below:

Application.OnKey "+m"

But the macro still runs when I press Shift and m.

How do I de-activate the original key assignment?

JKwan
03-08-2012, 09:00 AM
Don't you just leave your procedure blank:
Application.OnKey "^m", ""

Paul_Hossler
03-08-2012, 01:02 PM
ProcedureOptionalVariantA string indicating the name of the procedure to be run. If Procedure is "" (empty text), nothing happens when Key is pressed. This form of OnKey changes the normal result of keystrokes in Microsoft Excel. If Procedure is omitted, Key reverts to its normal result in Microsoft Excel, and any special key assignments made with previous OnKey methods are cleared.

Application.OnKey "^m"

(No " " at the end)

Paul

excel2006
03-14-2012, 07:44 AM
Thx for your replies.