+ Reply to Thread
Results 1 to 6 of 6

Triggering UserForm from Keyboard Shortcut

  1. #1
    Registered User
    Join Date
    12-26-2011
    Location
    San Francisco
    MS-Off Ver
    Excel 2010
    Posts
    45

    Triggering UserForm from Keyboard Shortcut

    I have a Userform called, "OmniSelectorForm"

    It has a Public Sub called OmniSelectorForm_Initialize

    I try to call this UserForm through a macro triggered by shortcut key (Control+E). Macro is simple:

    Please Login or Register  to view this content.
    Sadly, the form does not show up. However, if I press F5 on the macro I am calling through the shortcut key, the UserForm comes up just fine. Any ideas?

  2. #2
    Forum Expert tigeravatar's Avatar
    Join Date
    03-25-2011
    Location
    Colorado, USA
    MS-Off Ver
    Excel 2003 - 2013
    Posts
    5,361

    Re: Triggering UserForm from Keyboard Shortcut

    BeefNoodleSoup,

    I just tested that, and the userform opened as expected when I used a keyboard shortcut.

    It is important to note that keyboard shortcuts are case sensitive. So if your shortcut really is Ctrl+E, make sure you are using Ctrl+Shift+e to get the capital E.

    You can view/change a macro's keyboard shortcut by pressing Alt+F8 and then selecting the macro name (in this case 'OmniSelector') and then click Options.
    Hope that helps,
    ~tigeravatar

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  3. #3
    Registered User
    Join Date
    12-26-2011
    Location
    San Francisco
    MS-Off Ver
    Excel 2010
    Posts
    45

    Re: Triggering UserForm from Keyboard Shortcut

    My spreadsheet has a screenupdate so I know it's calling the macro but no UserForm shows up. I'll keep noodling on this, thanks for trying to help though

  4. #4
    Registered User
    Join Date
    12-26-2011
    Location
    San Francisco
    MS-Off Ver
    Excel 2010
    Posts
    45

    Re: Triggering UserForm from Keyboard Shortcut

    What did you name the UserForm and the Initialize event? I named my UserForm: OmniSelector in the Properties panel, but I left the initialize event as:

    Please Login or Register  to view this content.
    Reason being when I tried to change this to:

    Please Login or Register  to view this content.
    All it would do is pop up a form with no values inside

  5. #5
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Triggering UserForm from Keyboard Shortcut

    he Initialize event cannot be a Public Sub.

    Where's the short cut key, it's not in the code that you've posted
    Please Login or Register  to view this content.
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  6. #6
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: Triggering UserForm from Keyboard Shortcut

    the Initialize event can be public but there's no real reason to make it so.
    Josie

    if at first you don't succeed try doing it the way your wife told you to

+ 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