View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Jim Rech Jim Rech is offline
external usenet poster
 
Posts: 2,718
Default OnKey - usable to assign new shortcuts to existing Excel keyboard shortcuts?

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
"wal" wrote in message
...
| 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.