If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > PC based Database Applications > Microsoft Excel > using a shortcut key with a macro

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 03-09-05, 15:36
mikezcg mikezcg is offline
Registered User
 
Join Date: Oct 2003
Posts: 311
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?
Reply With Quote
  #2 (permalink)  
Old 03-09-05, 16:05
shades shades is offline
Registered User
 
Join Date: Oct 2003
Posts: 1,091
....changing
__________________
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

Last edited by shades; 03-09-05 at 16:10.
Reply With Quote
  #3 (permalink)  
Old 03-09-05, 16:13
mikezcg mikezcg is offline
Registered User
 
Join Date: Oct 2003
Posts: 311
Changing? and that means?
Reply With Quote
  #4 (permalink)  
Old 03-09-05, 16:40
savbill savbill is offline
Registered User
 
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
Reply With Quote
  #5 (permalink)  
Old 03-09-05, 17:18
shades shades is offline
Registered User
 
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
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On