Results 1 to 4 of 4
  1. #1
    Silver Lounger
    Join Date
    Jan 2001
    Location
    Northern, California, USA
    Posts
    1,886
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Hot Key for Button Click

    Hey!

    I have a button to close a userform. Does anyone have any insight on how I can assign a hotkey combination to effect the form closure? (Excel defaults forms to Modal, and doesn't allow you to change that...)

    Thanks!
    <IMG SRC=http://www.wopr.com/w3tuserpics/Kel_sig.gif>
    Moderator:<font color=448800> Pix Place, Internet Explorer</font color=448800>
    <small>www.kvisions.com

  2. #2
    WS Lounge VIP rory's Avatar
    Join Date
    Dec 2000
    Location
    Burwash, East Sussex, United Kingdom
    Posts
    6,280
    Thanks
    3
    Thanked 191 Times in 177 Posts

    Re: Hot Key for Button Click

    Hi Drk,
    You can assign an Accelerator key to the button in design view in the VBEditor. Just enter a letter as the accelerator and use Alt plus that letter as your shortcut.
    Hope that helps.
    Regards,
    Rory

    Microsoft MVP - Excel

  3. #3
    Uranium Lounger
    Join Date
    Jan 2001
    Location
    South Carolina, USA
    Posts
    7,295
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Hot Key for Button Click

    In design mode select the button and display its properties. In the "Accelerator" property type the key that you want to use. If the letter you choose is in the button name, that character will be underlined in the name.
    Legare Coleman

  4. #4
    Platinum Lounger
    Join Date
    Dec 2000
    Location
    Queanbeyan, New South Wales, Australia
    Posts
    3,730
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Hot Key for Button Click

    Drk,

    It works the same as in <A target="_blank" HREF=http://www.wopr.com/cgi-bin/w3t/showthreaded.pl?Cat=&Board=xl&Number=11237&page=&v iew=&sb=&vc=1#Post11237>this thread</A>.

    The difference between using a hotkey on a label and on a control, is that on a control, the key acts directly on that control, and not on the control following.
    Subway Belconnen- home of the Signboard to make you smile. Get (almost) daily updates- follow SubwayBelconnen on Twitter.

Posting Permissions

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