Creating shortcut keys in VB

0 views
Skip to first unread message

Will S

unread,
Apr 7, 2003, 7:33:00 AM4/7/03
to
Hey everyone.
I'm creating a macro right now that helps land surveyors calculate all
differential leveling field notes.
The problem I'm having is that I want my macros to run without having to go
into the "tools" menu and starting a macro. I want to create a shortcut key
so that when the user presses it (or the sequence) it will automate the
function.
Is there a way that I can do this? Please help me.

Thanks,
Will S.


Colo

unread,
Apr 7, 2003, 7:43:01 AM4/7/03
to
Hi Will,

Please click [option] button on the dialogue box named Macro in
tools>Macro>Macros
You can see [Short cut key] on the form named Macro Options.

HTH

Colo :-)

_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/

Colo - VBA guy! of 'The Road of The Cell Masters'
http://www.interq.or.jp/sun/puremis/colo/CellMastersLink.htm

/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_


"Will S" <wills...@hotmail.com> wrote in message
news:eq0UilP$CHA...@TK2MSFTNGP12.phx.gbl...

Will S

unread,
Apr 7, 2003, 7:55:38 AM4/7/03
to
Thanks Colo,

The thing is is that I already tried that. The problem that I have with
that is that when I open the macro on another computer, I have to keep going
back to do that. I don't want the users to do that also. I was hoping that
there might be some code that will work, something like an OnKeyDown. I've
done it before in a VB program I created, but most of the coding I learned I
forgot and I can't find it anywheres.
Hopefully you can help me.

Thanks Again
Will S.


Colo

unread,
Apr 7, 2003, 8:06:03 AM4/7/03
to
Ok Will,
So try MacroOptions Method.
Here is a sample code from help file.
MacroOptions Method Example

This example adds a shortcut key for the DoRand macro.

Application.MacroOptions Macro:="DoRand", _
HasShortcutKey:=True, ShortcutKey:="Z"
- Colo


_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
Colo - VBA guy! of 'The Road of The Cell Masters'
http://www.interq.or.jp/sun/puremis/colo/CellMastersLink.htm
/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_

"Will S" <wills...@hotmail.com> wrote in message

news:eoC4LyP$CHA....@TK2MSFTNGP10.phx.gbl...

Tom Ogilvy

unread,
Apr 7, 2003, 8:47:53 AM4/7/03
to
Look in help for OnKey.

Set up your shortcut keys in the workbook_open event.

Regards,
Tom Ogilvy


"Will S" <wills...@hotmail.com> wrote in message

news:eoC4LyP$CHA....@TK2MSFTNGP10.phx.gbl...

Reply all
Reply to author
Forward
0 new messages