View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Vergel Adriano Vergel Adriano is offline
external usenet poster
 
Posts: 857
Default Unassign Macro Keyboard Shortcut?

Dave,

Search the VBA help for the "OnKey" method. For example, if you have a
macro assigned to the shortcut CTRL+1, you can use this to clear it

Application.OnKey "^1"

you can just type it in the Immediate window of the VBE and hit Enter.


--
Hope that helps.

Vergel Adriano


"Dave Birley" wrote:

Not a show stopper, but when I am developing a complex Macro, I will often
record little slices of code and accept the default Macro name (Macro1,
Macro2... etc.), then to test it I may assign a keyboard shortcut to it so I
can give it a shot on several WS. Later I may want to re-use the shortcut
without deleting the original Macro. In other words I need to "unassign" the
shortcut to Macro[n], and assign it to Macro[n+x]. It's the old "quick and
dirty" game.

However when I use what seems logical, namely the Delete key, I get a
nasty-gram telling me that the shortcut meeds to be an alpha character.

That being said -- I have a hunch there is a way (the Help files being as
unhelpful as usual <g).
--
Dave
Temping with Staffmark
in Rock Hill, SC