Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
When using Excel's macro recorder to define a macro, one has the option of
giving it a keyboard shortcut. This appears in the finished macro as a comment. But comments are not executed, I thought. So what and where is the code giving the subroutine a shortcut, and how would one enter it on the code page directly rather than by using the macro recorder? Roger PB |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Roger,
That is just a comment to let you know that the macro is using a shortcut, it doesn't actually do anything about the shortcut. Delete the comments and the shortcut still works. Shortcut key details are held in Excel memory. -- HTH RP (remove nothere from the email address if mailing direct) "Roger PB" wrote in message ... When using Excel's macro recorder to define a macro, one has the option of giving it a keyboard shortcut. This appears in the finished macro as a comment. But comments are not executed, I thought. So what and where is the code giving the subroutine a shortcut, and how would one enter it on the code page directly rather than by using the macro recorder? Roger PB |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
If you export the module to a .bas file, then look at that file using notepad,
you can see the shortcut. You can assign the shortcut after the fact using: tools|macro|macros|options button You can assign a shortcut in code, too. Take a look at application.macrooptions: Option Explicit Sub testme() MsgBox "hi" End Sub Sub createshortcut() Application.MacroOptions macro:=ThisWorkbook.Name & "!testme", _ hasshortcutkey:=True, ShortcutKey:="C" End Sub This assigns ctrl-Shift-C to that TestMe msgbox routine Roger PB wrote: When using Excel's macro recorder to define a macro, one has the option of giving it a keyboard shortcut. This appears in the finished macro as a comment. But comments are not executed, I thought. So what and where is the code giving the subroutine a shortcut, and how would one enter it on the code page directly rather than by using the macro recorder? Roger PB -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Can you enable/disable macro keyboard shortcuts in excel 2003? | Excel Discussion (Misc queries) | |||
Keyboard Shortcuts | Excel Discussion (Misc queries) | |||
Keyboard shortcuts | Excel Discussion (Misc queries) | |||
KEYBOARD SHORTCUTS | Excel Discussion (Misc queries) | |||
Keyboard Shortcuts | Excel Programming |