LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,758
Default Macro keyboard shortcuts

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
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Can you enable/disable macro keyboard shortcuts in excel 2003? Burninator2000 Excel Discussion (Misc queries) 4 September 18th 07 03:48 PM
Keyboard Shortcuts wnfisba Excel Discussion (Misc queries) 3 December 8th 06 07:11 PM
Keyboard shortcuts Scott Excel Discussion (Misc queries) 2 January 25th 06 04:51 AM
KEYBOARD SHORTCUTS rm Excel Discussion (Misc queries) 8 May 18th 05 08:48 AM
Keyboard Shortcuts Ronald Dodge Excel Programming 3 February 25th 04 03:56 PM


All times are GMT +1. The time now is 06:24 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"