assign shortcut using ALT

J

John

Hi, I want to assign the following shortcut to my macro: CRTL-ALT-F9,
but the dialog doesn't allow ALT nor function keys. Is there any other
way to achieve this?

On the other hand, in Word I can pick any key on the keyboard including
CRTL-ALT-F9. I'm using Office 2002.

You would think that the two flagship programs in the same family would
have the same capability to assign shortcuts.

Any ideas?

John
 
E

Earl Kiosterud

John,

You can use Application.Onkey. For the Alt Y combination, run this code
(put it in Workbook_Open, perhaps):

Sub AltKeyInit()
Application.OnKey "%y", "MyMacro"
End Sub

Now when you press Alt y, it'll run MyMacro. See help on the OnKey method
for details.
 
J

JE McGimpsey

Couldn't one just assign another shortcut for a full recalc? Why tie
oneself to the shortcuts that MS comes up with?

Admittedly, it's much easier to assign shortcut keys in MacXL - it can
be done in the UI for nearly every command.
 
D

David McRitchie

I provided the VBA instruction to do just that, but I think
of the shortcuts as being part of the design and
changing shortcuts, blocking use of context menu, toolbar icons,
etc. as being counterproductive, makes it so people can't
help one another.

One exception would be if I had to use Excel 2003, I would definitly
change Ctrl+A just to be consistent with expected use.
See http://www.mvps.org/dmcritchie/excel/shortx2k.htm#foobar
even though I would probably start using Ctrl+Shift+Spacebar
and without praise for the person who decided to change Ctrl+A.

Of course with Excel 2003 which I think
not unlike using the Lotus 1-2-3 transition features and formulas and
then complaining about the way Excel works.

HTH,
David McRitchie, Microsoft MVP - Excel [site changed Nov. 2001]
My Excel Pages: http://www.mvps.org/dmcritchie/excel/excel.htm
Search Page: http://www.mvps.org/dmcritchie/excel/search.htm

JE McGimpsey said:
Couldn't one just assign another shortcut for a full recalc? Why tie
oneself to the shortcuts that MS comes up with?

Admittedly, it's much easier to assign shortcut keys in MacXL - it can
be done in the UI for nearly every command.

David McRitchie said:
Why would you want to override a shortcut that might get you out
of serious problems.

Recalculate all cells on all worksheets in all open workbooks [Ctrl+Alt+F9]
 
J

JE McGimpsey

Fair enough - I don't advocate changing things just for the sake of
change. And in fact, my personal setup changes very few built-in
shortcuts.

OTOH, in my commercial applications, I *never* use the standard
toolbars, including context menus, or assume the standard keyboard
shortcuts work (unless I set them via code).

I guess if someone's savvy enough to want to change the default kb
shortcut, I assume they're savvy enough to live with the consequences.
 
E

Earl Kiosterud

David,

I certainly agree about keeping things consistent. Why doesn't Microsoft
give folks some big furry dice to hang from the rearview mirror, and leave
everything else alone? :) I was once standing at a client's receptionist's
machine when she asked me if I could help her with Microsoft Word. "Sure,
start it up," I said, looking right at the screen. "It is," she said.
She'd changed the color scheme so much that I didn't even recognize it.
--
Earl Kiosterud
www.smokeylake.com

David McRitchie said:
I provided the VBA instruction to do just that, but I think
of the shortcuts as being part of the design and
changing shortcuts, blocking use of context menu, toolbar icons,
etc. as being counterproductive, makes it so people can't
help one another.

One exception would be if I had to use Excel 2003, I would definitly
change Ctrl+A just to be consistent with expected use.
See http://www.mvps.org/dmcritchie/excel/shortx2k.htm#foobar
even though I would probably start using Ctrl+Shift+Spacebar
and without praise for the person who decided to change Ctrl+A.

Of course with Excel 2003 which I think
not unlike using the Lotus 1-2-3 transition features and formulas and
then complaining about the way Excel works.

HTH,
David McRitchie, Microsoft MVP - Excel [site changed Nov. 2001]
My Excel Pages: http://www.mvps.org/dmcritchie/excel/excel.htm
Search Page: http://www.mvps.org/dmcritchie/excel/search.htm

JE McGimpsey said:
Couldn't one just assign another shortcut for a full recalc? Why tie
oneself to the shortcuts that MS comes up with?

Admittedly, it's much easier to assign shortcut keys in MacXL - it can
be done in the UI for nearly every command.

David McRitchie said:
Why would you want to override a shortcut that might get you out
of serious problems.

Recalculate all cells on all worksheets in all open workbooks
[Ctrl+Alt+F9]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top