Results 1 to 5 of 5
  1. #1
    Join Date
    Oct 2003
    Posts
    311

    Unanswered: using a shortcut key with a macro

    if i go into the vbe and write a code, how can i add a shortcut key to it?

    my code in my personal.xls file :

    module filter
    Sub Vendor()

    Dim s As String
    s = InputBox("Enter vendor search value", "Searching on vendor")
    Selection.AutoFilter Field:=2, Criteria1:="=" & s & "*", Operator:=xlAnd

    Range("A1").Select
    End Sub

    I want to add a shortcut key but how?

  2. #2
    Join Date
    Oct 2003
    Posts
    1,091
    ....changing
    Last edited by shades; 03-09-05 at 17:10.
    old, slow, and confused
    but at least I'm inconsistent!

    Rich
    (retired Excel 2003 user, 3/28/2008)

    How to ask a question on forums

  3. #3
    Join Date
    Oct 2003
    Posts
    311
    Changing? and that means?

  4. #4
    Join Date
    Feb 2004
    Posts
    533
    Quote Originally Posted by mikezcg
    I want to add a shortcut key but how?
    With your personal.xls (code) file open. Select from the Tools Menu: "Tools-Macro->Macros...", or use {Alt+F8} keys. This will open the Macros dialog window showing a list of availabel macros.

    Find the name of your macro you want to add the shortcut key to. Select it.

    The 'Options...' button will be enabled. Click it.

    Enter a key combination to use as the shortcut.

    You may need to close and restart your file to have the changes take effect.

    Its a good idea to try your shortcut combination prior to assigning it to a macro to check if you are setting something already used as a shortcut.


    ~
    ~

    Bill

  5. #5
    Join Date
    Oct 2003
    Posts
    1,091
    Quote Originally Posted by mikezcg
    Changing? and that means?
    I had a senior moment...
    old, slow, and confused
    but at least I'm inconsistent!

    Rich
    (retired Excel 2003 user, 3/28/2008)

    How to ask a question on forums

Posting Permissions

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