Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
OnKey Method
I got a response from Tom Ogilvy regarding how to assign a shortcut key to VB
code, which was to use the OnKey Method. My problem is I'm a bit dim when it comes to methods, etc. Does the method go into a procedure of its own which then calls the onkey procedure? Obviously, I'm really confused. Thanks for any help I can get. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
OnKey Method
Sub SetAssignment()
Application.OnKey "^r", "MyMacro" End Sub Sub ResetAssignment() Application.OnKey "^r" End sub You would have to run SetAssignment, then if you did Ctrl+r you should have MyMacro run. If you run ResetAssignment, Ctrl+r is set back to its default action This is only in effect as long as Excel is open. When you do the assignment, the workbook containing mymacro should be open. If you want to have this assignment in effect most of the time, put the assignment macro and the macro to execute in in your Personal.xls and in the workbook_open event of personal.xls, call the setassignment macro. -- Regards, Tom Ogilvy "cottage6" wrote in message ... I got a response from Tom Ogilvy regarding how to assign a shortcut key to VB code, which was to use the OnKey Method. My problem is I'm a bit dim when it comes to methods, etc. Does the method go into a procedure of its own which then calls the onkey procedure? Obviously, I'm really confused. Thanks for any help I can get. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
onkey method | Excel Discussion (Misc queries) | |||
Problem mapping procedure using OnKey Method | Excel Programming | |||
onkey | Excel Programming | |||
Onkey Method | Excel Programming | |||
Onkey | Excel Programming |