Hi,
I want help to add shortcut keys to all the custom menus/sub-menus in tool
o For example, for the “Juniper Tool 1B” menu item, use “J” as the shortcut key.
It's urgent, Can someone please help. I am relatively new to Excel programming.
Hi,
I want help to add shortcut keys to all the custom menus/sub-menus in tool
o For example, for the “Juniper Tool 1B” menu item, use “J” as the shortcut key.
It's urgent, Can someone please help. I am relatively new to Excel programming.
Hi, you can do it using the & sign before the letter you want to use as shortcut:
This will generate the Menu name with A as shortcut.![]()
Please Login or Register to view this content.
Visit the Advanced Features Add-In for MS 2003 Official Website or if you're looking for VBA help you can just surf the VBA Handbook
I have the code like this:
So, I add this line, after the Call CreateMenu?![]()
Please Login or Register to view this content.
Last edited by romperstomper; 08-17-2010 at 04:25 AM.
Hi Gayathri,
At run time you need to add this line of code. The object name for the sub menu (the one which is going to be customized) will be set at run time.
Regards,
Ram
You need to alter your CreateMenu subroutine to change the captions it uses.
Everyone who confuses correlation and causation ends up dead.
I see that there is a line which says MenuObject.Caption = Caption, based on the value passed on to the MenuObject. Now, if I want to underline the first letter of each of the value passed to Caption, how to I do that with the & symbol?
This is what I have presently
![]()
Please Login or Register to view this content.
Last edited by romperstomper; 08-17-2010 at 04:41 AM. Reason: add code tags
Use:
and:![]()
Please Login or Register to view this content.
Note: you must use code tags when posting code, as specified in the forum rules. I have added them for you on this occasion but you must do it in future.![]()
Please Login or Register to view this content.
I apologize. Henceforth, I shall add them in future.
Thanks for your response. Just a question to improve my understanding. If the first letter had to be chosen as shortcut key, an & was used before the Caption. If any other letter has to be "shortkeyed" then, how is that achieved?
Well, the simplest way would be to leave the code as it was originally and add the & signs to the cells containing the captions. Otherwise you would have to parse the caption strings to work out where to put the & sign.
Thank you very much, and is there a way I can add short cut keys to buttons on the sheet also?
If you are using buttons from the control toolbox, then set the Accelerator property to the letter you want. If you are using Forms controls, then you can assign a shortcut key via the macros dialog to the macro that is attached to the button. (even though the Button object has an Accelerator property, I don't know of any way to set it).
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks