ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Running macros from shortcut keys (https://www.excelbanter.com/excel-programming/332214-running-macros-shortcut-keys.html)

Darren Hill[_3_]

Running macros from shortcut keys
 
When you record a macro, you can assign it a shortcut key. Is there a way
to assign a shortcut key to a macro that already exists?

Also, is there a way to intercept function keys (like, say, F9) and run a
macro along with the normal function of the key?
I have a number of non-volatile UDF's I'd like to update when I choose,
and linking them top F9 seems a fitting thing. If there's a better way,
I'll happily accept it.

-----------
Darren

Darren Hill[_3_]

Running macros from shortcut keys
 
On Sat, 18 Jun 2005 17:53:42 +0100, Darren Hill
wrote:

When you record a macro, you can assign it a shortcut key. Is there a
way to assign a shortcut key to a macro that already exists?


I've figured out the answer to the question above, but not the one below.
:)


Also, is there a way to intercept function keys (like, say, F9) and run
a macro along with the normal function of the key?
I have a number of non-volatile UDF's I'd like to update when I choose,
and linking them top F9 seems a fitting thing. If there's a better way,
I'll happily accept it.

-----------
Darren


Damon Longworth

Running macros from shortcut keys
 
Have a look at Application.Volatile in help.



"Darren Hill" wrote in message
news:op.sskr3ic0ed89cl@omega...
On Sat, 18 Jun 2005 17:53:42 +0100, Darren Hill
wrote:

When you record a macro, you can assign it a shortcut key. Is there a
way to assign a shortcut key to a macro that already exists?


I've figured out the answer to the question above, but not the one below.
:)


Also, is there a way to intercept function keys (like, say, F9) and run
a macro along with the normal function of the key?
I have a number of non-volatile UDF's I'd like to update when I choose,
and linking them top F9 seems a fitting thing. If there's a better way,
I'll happily accept it.

-----------
Darren




Bob Phillips[_6_]

Running macros from shortcut keys
 


"Darren Hill" wrote in message
news:op.sskrvsjyed89cl@omega...
When you record a macro, you can assign it a shortcut key. Is there a way
to assign a shortcut key to a macro that already exists?


ToolsMacrosMacros... select your macro and click Options

Also, is there a way to intercept function keys (like, say, F9) and run a
macro along with the normal function of the key?
I have a number of non-volatile UDF's I'd like to update when I choose,
and linking them top F9 seems a fitting thing. If there's a better way,
I'll happily accept it.


Why not just precede the code by

Application.Volatile



Darren Hill[_3_]

Running macros from shortcut keys
 
On Sat, 18 Jun 2005 18:10:47 +0100, Bob Phillips
wrote:

Why not just precede the code by

Application.Volatile


I don't want the values to update whenever the sheet is calculated, only
when I choose to. But I figured a way to do it - put a cell reference as
optional input for each of the UDF's, then have a button which sticks a
random number in that cell whenever it's clicked.
Out of curiousity, is there a way to capture key inputs like F9?

------------------
Darren

Bob Phillips[_6_]

Running macros from shortcut keys
 
application.onkey "{F9}","xyz"

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Darren Hill" wrote in message
news:op.ssks5ev4ed89cl@omega...
On Sat, 18 Jun 2005 18:10:47 +0100, Bob Phillips
wrote:

Why not just precede the code by

Application.Volatile


I don't want the values to update whenever the sheet is calculated, only
when I choose to. But I figured a way to do it - put a cell reference as
optional input for each of the UDF's, then have a button which sticks a
random number in that cell whenever it's clicked.
Out of curiousity, is there a way to capture key inputs like F9?

------------------
Darren




Darren Hill[_3_]

Running macros from shortcut keys
 
On Sat, 18 Jun 2005 19:35:35 +0100, Bob Phillips
wrote:

application.onkey "{F9}","xyz"

Am I currect in assuming this would have to be in some kind of macro that
was running constantly in the background? How would you do that? A pointer
to a webpage where I could research this myself would be fine.
Could it be in a worksheet event (I don't see a BeforeKeyRelease sadly)?

Darren


All times are GMT +1. The time now is 02:56 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com