Disabling Shortcut Keys...
MZ Tools makes life easier for the Excel VBA coder
Thanks Thanks:  0
Likes Likes:  0
Results 1 to 6 of 6

Thread: Disabling Shortcut Keys...

  1. #1
    Board Regular
    Join Date
    Feb 2002
    Posts
    97
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

     
    Does anyone have experience or know how to disable shortcut keys for an excel workbook. I would like to disable such keys as ctrl+s, ctrl+o, as well as alt+f8 (displays macros shortcut menu), and any other shortcut keys that intitalize shortcut menus.

  2. #2
    MrExcel MVP Mark O'Brien's Avatar
    Join Date
    Feb 2002
    Location
    Columbus, OH, USA
    Posts
    3,530
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Haven't done this myself, but I know people like Juan Pablo G. have suggested this in the past.

    Using VBA you can use the "OnKey" command to disable certain key combos, exmaple taken from VBA help:

    This example disables the SHIFT+CTRL+RIGHT ARROW key sequence.

    Application.OnKey "+^{RIGHT}", ""


    HTH


  3. #3
    Board Regular
    Join Date
    Feb 2002
    Posts
    97
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Thanks a bunch Mark. I guess it's not hard to find, but of the top of your head, what's the equivalent to "ALT" in vb code?

  4. #4
    MrExcel MVP Mark O'Brien's Avatar
    Join Date
    Feb 2002
    Location
    Columbus, OH, USA
    Posts
    3,530
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    I believe ALT is %, off the top of my head.

    Cheers

  5. #5
    Board Regular
    Join Date
    Feb 2002
    Posts
    97
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Thanks again Mark, and I'm sorry about this, but I've been looking and can't seem to find it. What would the "F#" keys be. "F18" for example?

  6. #6
    Board Regular
    Join Date
    Mar 2002
    Posts
    67
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

      
    Hey, charlie I work at Domtar as well
    I am in Cornwall Mill
    Anyways
    I got this from excel help. I hope this is what you need



    Key Code
    BACKSPACE {BACKSPACE} or {BS}
    BREAK {BREAK}
    CAPS LOCK {CAPSLOCK}
    CLEAR {CLEAR}
    DELETE or DEL {DELETE} or {DEL}
    DOWN ARROW {DOWN}
    END {END}
    ENTER (numeric keypad) {ENTER}
    ENTER ~ (tilde)
    ESC {ESCAPE} or {ESC}
    HELP {HELP}
    HOME {HOME}
    INS {INSERT}
    LEFT ARROW {LEFT}
    NUM LOCK {NUMLOCK}
    PAGE DOWN {PGDN}
    PAGE UP {PGUP}
    RETURN {RETURN}
    RIGHT ARROW {RIGHT}
    SCROLL LOCK {SCROLLLOCK}
    TAB {TAB}
    UP ARROW {UP}
    F1 through F15 {F1} through {F15}


    You can also specify keys combined with SHIFT and/or CTRL and/or ALT. To specify a key combined with another key or keys, use the following table.

    To combine keys with Precede the key code by
    SHIFT + (plus sign)
    CTRL ^ (caret)
    ALT % (percent sign)


User Tag List

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

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

 

 
DMCA.com