Consulting

Results 1 to 6 of 6

Thread: Solved: Create shortcut

  1. #1
    VBAX Regular
    Joined
    Feb 2010
    Posts
    32
    Location

    Solved: Create shortcut

    Hi.

    Is there a way of creating a shortcut in excel?

    I would like to create a new keystrok combination, say for instance Shift/Alt/H/ to fire off some code.

    Thanks.


  2. #2
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    You would use

    [vba]application.OnKey "+%h","test"[/vba]

    but that didn't work for me, it brought up the help menu.
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  3. #3
    VBAX Regular
    Joined
    Feb 2010
    Posts
    32
    Location
    Yeah, some of them are pre-defined. Shift/Alt/q works though.
    Thanks a lot.

  4. #4
    VBAX Regular
    Joined
    Feb 2010
    Posts
    32
    Location
    On another note, any idea how to disable existing key-strokes?
    I would like to diasble Alt+F11 (to show the VB editor)

  5. #5
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    Do an OnKey without the second parameter.
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  6. #6
    VBAX Regular
    Joined
    Feb 2010
    Posts
    32
    Location
    Yeah, that works great.

    Thanks a lot.

Posting Permissions

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