Assigning Macros to Function Keys?

J

Jane

Excel 2002, Windows XP

I would like to simplify Edit/Paste by assigning that to
the F1 key. As far as I can tell, using
Toolbars\Customize doesn't help. Also, although I can
assign a macro to a CTRL key, I haven't seen any options
for assigning the macro to one of the function keys.

Have I missed something?

Or can anyone advise on how to use VBA to do this? (I
have basic (very) knowledge of VB.)

This is a obviously not a high priority question... but I
am peeved because I know it should be do-able and don't
have the time (ability?) to figure out how to use VBA for
this.

Thank-you for your help.

Jane
 
E

Earl Kiosterud

Jane,

First, this needs to be run (it might be in the Workbook_Open event):

Sub SetUpKeys()
Application.OnKey "{F1}", "Paste"
End Sub

Now have this in the project (workbook):

Sub Paste()
ActiveSheet.Paste
End Sub

Now whenever F1 is pressed, it will run macro "Paste." Note that this will
take effect even when in another workbook and F1 is pressed.

You don't like using the standard Ctrl-v shortcut for paste? Ctrl-c for
copy, etc?
 

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

Similar Threads


Top