Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 45
Default how do you say in VBA?

in VBA how do you say, "If the #1 key is pressed then, RUNMACRO"?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default how do you say in VBA?

Hi Spencer,

Look at the OnKey method in VBA help.

---
Regards,
Norman



"Spencer Hutton" wrote in message
...
in VBA how do you say, "If the #1 key is pressed then, RUNMACRO"?



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default how do you say in VBA?

Look in Excel VBA help at the OnKey method.

--
Regards,
Tom Ogilvy


"Spencer Hutton" wrote in message
...
in VBA how do you say, "If the #1 key is pressed then, RUNMACRO"?



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 48
Default how do you say in VBA?

Hi,
If your trying to set a key to run a Macro. Select "Tool" then select
"Macro" Then select "Macro" a list of macro's should be displayed. select
which macro you want to run then select the "Option's" and assign it to a
key (Alpha). click OK. then close out. When you want to run the Macro you
can press "Cntl" and "q" this will excute the Macro.(assumed you assigned
"q")


"Spencer Hutton" wrote in message
...
in VBA how do you say, "If the #1 key is pressed then, RUNMACRO"?



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,163
Default how do you say in VBA?

OnKey will do what you want - see VBA help for details

OnKey "1","MyMacro"


"Spencer Hutton" wrote:

in VBA how do you say, "If the #1 key is pressed then, RUNMACRO"?



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 45
Default how do you say in VBA?

Great it works, but how does excel tell the difference between the number one
above the keys, and the number one on the numeric keypad?

"Tom Ogilvy" wrote:

Look in Excel VBA help at the OnKey method.

--
Regards,
Tom Ogilvy


"Spencer Hutton" wrote in message
...
in VBA how do you say, "If the #1 key is pressed then, RUNMACRO"?




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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



All times are GMT +1. The time now is 03:26 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"