+ Reply to Thread
Results 1 to 7 of 7

Assigning a shortcut to ctrl and shift and the number pad

  1. #1
    Valued Forum Contributor luv2glyd's Avatar
    Join Date
    07-13-2008
    Location
    Seattle, WA, US
    MS-Off Ver
    Excel 2010
    Posts
    679

    Cool Assigning a shortcut to ctrl and shift and the number pad

    I am trying to assign a shortcut to run macro with a combination of keys pressed at the same time: control shift 1. The 1 is on the number pad rather than up near F1 key. Using the following code:

    Please Login or Register  to view this content.
    ... and having no luck. Got the number pad onkey shortcuts from this post: http://www.excelforum.com/excel-prog...umber-pad.html

    Thanks
    Last edited by luv2glyd; 01-18-2014 at 04:49 PM.
    You either quit or become really good at it. There are no other choices.

  2. #2
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,613

    Re: Assigning a shortcut to ctrl and shift and the number pad

    Your code worked for me.

    Use 35 with the num lock off and 97 with the num lock on.
    Surround your VBA code with CODE tags e.g.;
    [CODE]your VBA code here[/CODE]
    The # button in the forum editor will apply CODE tags around your selected text.

  3. #3
    Valued Forum Contributor luv2glyd's Avatar
    Join Date
    07-13-2008
    Location
    Seattle, WA, US
    MS-Off Ver
    Excel 2010
    Posts
    679

    Re: Assigning a shortcut to ctrl and shift and the number pad

    Still no luck. Maybe it has to do with Excel version? I have 2010...

  4. #4
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,613

    Re: Assigning a shortcut to ctrl and shift and the number pad

    Maybe, but I doubt it.

    Did you run your Application.OnKey line within a procedure to trap the key-press combination? Can you show the whole procedure?

    What does my_macro do? Is it spelled right; e.g. not mymacro?
    Where is my_macro located?
    Last edited by AlphaFrog; 01-18-2014 at 03:21 PM.

  5. #5
    Valued Forum Contributor luv2glyd's Avatar
    Join Date
    07-13-2008
    Location
    Seattle, WA, US
    MS-Off Ver
    Excel 2010
    Posts
    679

    Re: Assigning a shortcut to ctrl and shift and the number pad

    Hey AF,

    Here's the file, the full code is:

    Please Login or Register  to view this content.
    I run "test" first to tie the keys to "my_macro" and then go and try pressing the shortcut keys.

    shortcut test.xlsm

    PS: trying "0" on the number pad here, which is {96}.
    Last edited by luv2glyd; 01-18-2014 at 03:38 PM.

  6. #6
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,613

    Re: Assigning a shortcut to ctrl and shift and the number pad

    I couldn't get your code to work as well. I don't know why.

    I did get this to work though.

    Please Login or Register  to view this content.
    Only the 97 (num lock on) keypress is in effect. But cycling through both seems to make a difference.

  7. #7
    Valued Forum Contributor luv2glyd's Avatar
    Join Date
    07-13-2008
    Location
    Seattle, WA, US
    MS-Off Ver
    Excel 2010
    Posts
    679

    Re: Assigning a shortcut to ctrl and shift and the number pad

    Ok, thank you for taking a look - that works for me as well!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Ctrl+shift+enter
    By stuntmannen in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 03-06-2013, 09:56 AM
  2. KeyCodes for using Shift+Ctrl
    By Mamud in forum Excel Programming / VBA / Macros
    Replies: 24
    Last Post: 11-25-2011, 12:38 PM
  3. CTRL+F - Shortcut key
    By excelhlp in forum Excel General
    Replies: 1
    Last Post: 08-09-2010, 11:49 PM
  4. using Ctrl+M as shortcut
    By tryer in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 11-06-2008, 10:01 AM
  5. Macro's with Ctrl or Ctrl-Shift?
    By Al Franz in forum Excel General
    Replies: 6
    Last Post: 09-05-2005, 06:05 PM

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