+ Reply to Thread
Results 1 to 4 of 4

Keyboard shortcuts - onkey, macrooptions, other?

  1. #1
    Forum Expert
    Join Date
    08-27-2008
    Location
    England
    MS-Off Ver
    2010
    Posts
    2,561

    Keyboard shortcuts - onkey, macrooptions, other?

    I set keyboard shortcuts for my personal.xls macros using iterations of application.onkey in the workbook_open event. (NB mods, have avoided code tags to make sentence readable).

    I don't simply set shortcuts via the "macros" pop-out menu as i like to use different combinations of Ctrl, Shift & Alt... unless I'm mistaken the pop-out menu doesn't give that degree of flexibility (happy to be corrected).

    That is because that is what I learned first, not because I have a clever reason for it.

    Recently, I have come across macrooptions - corresponding to the macro options dialgoue box, which I understand I could use to set shortcuts in almost exactly the same way. My question is, should I?

    Application.onkey feels "tacky" whilst macrooptions feels more "inbuilt" (robust?) but feelings like this are weak reasons for any kind of decision, particularly knowing that Excel is often fairly quirky (read: "backwards") when it comes to "the best way". Also, setting onkeys on open could be seen as overkill - but then perhaps it's more editable than a run-once assignment of macro shortcuts...?

    Input gratefully received.

    CC

  2. #2
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,431

    Re: Keyboard shortcuts - onkey, macrooptions, other?

    Macro shortcuts do appear to be confined to CTRL+ <char>

    So any other combination would require OnKey

    Personally I don't use keyboard shortcuts to my code. I build menus/toolbars.

    I have not seen anything to say MacroOptions is either better or worse that OnKey. Although using MacroOptions means that the Macro Dialog > Options will reflect the correct keystroke combination.
    Cheers
    Andy
    www.andypope.info

  3. #3
    Forum Expert
    Join Date
    08-27-2008
    Location
    England
    MS-Off Ver
    2010
    Posts
    2,561

    Re: Keyboard shortcuts - onkey, macrooptions, other?

    Cheers for replying Andy,

    I think you can add shift (i.e. Ctrl+shift+<key>) but not have shift alone or any combo with/without Alt.

    I have menus too, but some of my macros I use so often I prefer to have them nearer to hand.

    As it stands, I'm going to stick with the way I have it.

  4. #4
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,431

    Re: Keyboard shortcuts - onkey, macrooptions, other?

    Yes SHIFT can also be included. But it is automatically included depending on the char used. CTRL+a and CTRL+A or more fully CTRL+SHIFT+a

    As you say for complete flexibility use onkey

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1