Results 1 to 8 of 8
  1. #1
    Super Moderator WebGenii's Avatar
    Join Date
    Jan 2001
    Location
    Redcliff, Alberta, Canada
    Posts
    4,066
    Thanks
    2
    Thanked 5 Times in 5 Posts

    Where have the Shortcut Keys gone? (Excel 2000/SR-1)

    Just fooling around with shortcut keys for macros - something that I haven't thought about for a long while.
    I'm assigning shortcut keys to macros in my personal.xls file. I'm using the Macros dialog box, selecting the macro and using the Options button to set the shortcut key.
    My question is - now that I'm looking at my macros in the VBA Editor is "where" did Excel put the shortcut key info. It used to be in the macro itself. However, I don't see it.

    Suggestions?
    [b]Catharine Richardson (WebGenii)
    WebGenii Home Page
    Moderator: Spreadsheets, Other MS Apps, Presentation Apps, Visual Basic for Apps, Windows Mobile

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Where have the Shortcut Keys gone? (Excel 2000/SR-1)

    When you record a macro and set a shortcut key before starting to record, Excel will insert a comment in the macro code. But this is only a comment - it won't change if you modify or remove the shortcut key. I think that key assignments are stored in your .xlb file, and I don't know of an easy way to view them (except Tools | Macro | Macros..., Options... button as mentioned by you)

  3. #3
    Super Moderator WebGenii's Avatar
    Join Date
    Jan 2001
    Location
    Redcliff, Alberta, Canada
    Posts
    4,066
    Thanks
    2
    Thanked 5 Times in 5 Posts

    Re: Where have the Shortcut Keys gone? (Excel 2000/SR-1)

    <P ID="edit" class=small>(Edited by WebGenii on 13-May-03 11:07. Oops - no the .xlb file IS there, just took a while to show up.)</P>Interesting, I am working on a new system - and I can't find an .xlb file. (No toolbars have been created/customized yet. But the shortcut keys are there...
    Hmmm
    [b]Catharine Richardson (WebGenii)
    WebGenii Home Page
    Moderator: Spreadsheets, Other MS Apps, Presentation Apps, Visual Basic for Apps, Windows Mobile

  4. #4
    5 Star Lounger jujuraf's Avatar
    Join Date
    Jun 2001
    Location
    San Jose, California, USA
    Posts
    1,061
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Where have the Shortcut Keys gone? (Excel 2000/SR-1)

    Yeh, as someone else said, shortcut keys you assign to macros you record are only shown as comments in the created code. Also be very careful as Excel will let you assign a short cut key to something that's already assigned (no warning given) and you'll lhave a very hard time restoring it (actually I don't know how'd you restore the original definition of a key <img src=/S/eyeout.gif border=0 alt=eyeout width=15 height=15> ).

    Suggestion. <img src=/S/munch.gif border=0 alt=munch width=19 height=17> It's best to keep a list of known existing shortcuts and compare the one you want to use against that or always use Ctrl + Alt + <key> since there aren't any that use both Ctrl+Alt (although there are ones that use Ctrl+Shift or Alt+Shift.

    Deb

  5. #5
    Platinum Lounger
    Join Date
    Nov 2001
    Location
    Vienna, Wien, Austria
    Posts
    5,009
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Where have the Shortcut Keys gone? (Excel 2000

    Have you ever opened someone else's macro-filled product and suddenly found that even the most basic of shortcut keys (Ctrl+A, Ctrl+C etc.) suddenly do something that you never quite expected them to? <img src=/S/bouncenburn.gif border=0 alt=bouncenburn width=31 height=31>
    Gre

  6. #6
    WS Lounge VIP sdckapr's Avatar
    Join Date
    Jul 2002
    Location
    Pittsburgh, Pennsylvania, USA
    Posts
    11,225
    Thanks
    14
    Thanked 342 Times in 335 Posts

    Re: Where have the Shortcut Keys gone? (Excel 2000/SR-1)

    I have found that if you remove the custom shortcut the original shortcut key is restored.
    You can remove a custom shortcut via tools - macro - macros - options..

    Steve

  7. #7
    5 Star Lounger jujuraf's Avatar
    Join Date
    Jun 2001
    Location
    San Jose, California, USA
    Posts
    1,061
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Where have the Shortcut Keys gone? (Excel 2000/SR-1)

    Ah, the ol' Options button, I had never clicked that one before as I rarely record macros anymore and when I did it was just to learn what functions to call and then write my own so I never assigned function keys.

    Good to know. <img src=/S/bravo.gif border=0 alt=bravo width=16 height=30>

    Thnx, Deb

  8. #8
    Star Lounger
    Join Date
    Jan 2001
    Location
    U.S. - East Coast
    Posts
    73
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Where have the Shortcut Keys gone? (Excel 2000/SR-1)

    I posted a similar question a few days ago (http://www.wopr.com/cgi-bin/w3t/show...b=5&o=0&fpart=) and didn't receive any replies. My own research indicates that Excel's object model does not have a method for retrieving custom shortcuts. For a mature product such as Excel this is particularly problematic, especially since the desired behavior can be achieved in Word via the KeyBindings object.

Posting Permissions

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