+ Reply to Thread
Results 1 to 5 of 5

assigning keystroke shortcuts to macros

  1. #1
    Registered User
    Join Date
    11-28-2012
    Location
    Karnataka, India
    MS-Off Ver
    Excel 2007
    Posts
    48

    assigning keystroke shortcuts to macros

    is there no way wer i can assign a number as a keystroke shortcut for a macro??
    eg Ctrl+1 or Ctrl+2 like this??

    because my macros add the values 1to7 to a particular cell, it ll only be easy if i assign a number as shortcut. so please help

  2. #2
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: assigning keystroke shortcuts to macros

    How about:

    Please Login or Register  to view this content.
    If I've helped you, please consider adding to my reputation - just click on the liitle star at the left.

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~(Pride has no aftertaste.)

    You can't do one thing. XLAdept

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~aka Orrin

  3. #3
    Valued Forum Contributor
    Join Date
    06-19-2010
    Location
    Holywell, N Wales, UK
    MS-Off Ver
    Excel 2013
    Posts
    470

    Re: assigning keystroke shortcuts to macros

    You could use the .OnKey method

    Please Login or Register  to view this content.
    Please Login or Register  to view this content.
    This example would use Ctrl-2
    If this was helpful then please click the small star icon at the bottom left of my post. A little appreciation goes a long way.

  4. #4
    Registered User
    Join Date
    11-28-2012
    Location
    Karnataka, India
    MS-Off Ver
    Excel 2007
    Posts
    48

    Re: assigning keystroke shortcuts to macros

    it worked but one problem, its not working for the number pad keys.. y is that??

  5. #5
    Valued Forum Contributor
    Join Date
    06-19-2010
    Location
    Holywell, N Wales, UK
    MS-Off Ver
    Excel 2013
    Posts
    470

    Re: assigning keystroke shortcuts to macros

    I believe that the number pad keys 0-9 are represented by the. "codes" 96-105.
    So,
    Please Login or Register  to view this content.
    Would respond to 4 on the keypad.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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