Consulting

Results 1 to 12 of 12

Thread: Solved: Create A Short Cut Key in Menu

  1. #1

    Solved: Create A Short Cut Key in Menu

    I want to Create a shortcut key from keyboard menu.
    How to Create ?

  2. #2
    VBAX Newbie
    Joined
    Feb 2007
    Location
    Bombay, India
    Posts
    2
    Location
    Hi

    Could you please explain what type of shortcut key ? Are we talking about the Menu options or some kind of a macro shortcut key ?

  3. #3

    Userform Create Short key

    i don't want to used mouse.
    so that Create in Keyborad shortcut
    And Use only Keyboard

    Quote Originally Posted by Stormseed
    Hi

    Could you please explain what type of shortcut key ? Are we talking about the Menu options or some kind of a macro shortcut key ?

  4. #4
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    I think you are stuck. A form doesn't respond to Excel shortcuts, and the usual method of & a characater in a button and using Alt-character to invoke it doesn't work on these menu items. You might be able to hook some API in to delegate it to, but I am not sure at this moment what.
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  5. #5
    Can I Use Faction menu ? About ("F1", "F2"....)

  6. #6
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    What is Faction Menu?
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  7. #7
    VBAX Newbie
    Joined
    Feb 2007
    Location
    Bombay, India
    Posts
    2
    Location
    Quote Originally Posted by xld
    What is Faction Menu?
    I guess, OP means to say "Function Menu" ? not sure..

  8. #8
    ya sure "Function Menu"
    key on keyboard ("F1" to "F12")

  9. #9
    Mac Moderator VBAX Guru mikerickson's Avatar
    Joined
    May 2007
    Location
    Davis CA
    Posts
    2,778
    One ugly way to do it would be to use the _KeyDown events of every control in the Userform.

  10. #10
    How to Used ?
    about the_keyDown events?
    Can u Have any Code of keydown?

  11. #11
    Mac Moderator VBAX Guru mikerickson's Avatar
    Joined
    May 2007
    Location
    Davis CA
    Posts
    2,778
    Put this in the UF code module and mySub will run everytime Shift+F5 is pressed.
    [VBA]Private Sub CommandButton1_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, ByVal Shift As Integer)
    If KeyCode * Shift = 116 Then
    Call mySub
    End If
    End Sub

    Private Sub TextBox1_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, ByVal Shift As Integer)
    If KeyCode * Shift = 116 Then
    Call mySub
    End If
    End Sub

    Private Sub UserForm_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, ByVal Shift As Integer)
    If KeyCode * Shift = 116 Then
    Call mySub
    End If
    End Sub

    Sub mySub()
    MsgBox "x"
    End Sub[/VBA]

  12. #12
    done. Thank You

Posting Permissions

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