ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   OnKey - usable to assign new shortcuts to existing Excel keyboardshortcuts? (https://www.excelbanter.com/excel-programming/419069-onkey-usable-assign-new-shortcuts-existing-excel-keyboardshortcuts.html)

wal

OnKey - usable to assign new shortcuts to existing Excel keyboardshortcuts?
 
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.

Jim Rech

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.


wal

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

On Oct 27, 9:06*am, "Jim Rech" wrote:
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.




All times are GMT +1. The time now is 05:24 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com