OnKey - usable to assign new shortcuts to existing Excel keyboardshortcuts?

W

wal

Excel 2003

Sorry if this is a repeat post. Google Groups seems to take posts
about 2/3 of the time. Anyway...

It appears that Application.OnKey can do only the three following
tasks:
- Remove the assignment of an Excel keyboard shortcut.
- Restore that assignment.
- Assign a keyboard shortcut to a **MACRO**.

Can it also be used to assign a customized keyboard shortcut to an
ordinary Excel feature? For example, I'd like to assign F3 to "Find
Next" (whose default shortcut is Shift-F4; I often end up hitting Ctrl-
F4 and closing the workbook). I'd lose the existing functionality of
F3, but I never use it anyway.

If not OnKey, is there another VBA Method that would do this?

Thanks.
 
J

Jim Rech

You got responses to your post yesterday. I'll repeat mine:

Sub AssignF3ToFindNext()
Application.OnKey "{F3}", "MyFindNext"
End Sub

Sub MyFindNext()
Cells.FindNext(Selection).Select
End Sub


--
Jim
| Excel 2003
|
| Sorry if this is a repeat post. Google Groups seems to take posts
| about 2/3 of the time. Anyway...
|
| It appears that Application.OnKey can do only the three following
| tasks:
| - Remove the assignment of an Excel keyboard shortcut.
| - Restore that assignment.
| - Assign a keyboard shortcut to a **MACRO**.
|
| Can it also be used to assign a customized keyboard shortcut to an
| ordinary Excel feature? For example, I'd like to assign F3 to "Find
| Next" (whose default shortcut is Shift-F4; I often end up hitting Ctrl-
| F4 and closing the workbook). I'd lose the existing functionality of
| F3, but I never use it anyway.
|
| If not OnKey, is there another VBA Method that would do this?
|
| Thanks.
 

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