Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Assign Keybindings to a Userform
I'm making a calculator type userform. It will be easier to use that for
someone to find a calculator, and will have additional options for inserting values into the active sheet. I've made the *current* buttons on the userform look exactly like the numberpad on my keyboard, without the pgup, home, del, etc, just the numbers and such. What I'd like to do is let people simply use the numberpad on their keyboard to "activate" the buttons on the userform, like 4, or + I tried an Application.OnKey "7","Command7_Click" in the userform initialisation, but that didn't work, it threw up an error. So I'm assuming that I can't link to a userform macro or something? I also tried to use the "Accelerator" field, but that only works when Alt is pressed down. And only works on the keyboard section, rather than the numberpad. So I have one 7 that works when I press shift, but one that doesn't. Is there a quick way to assign the numberpad keys (including numlock) to buttons on a userform? Since they're command buttons, it doesn't need to press the button as such, just trigger the "commandbutton_click" event. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Assign Keybindings to a Userform
On 16 May, 16:44, PaulW wrote:
I'm making a calculator type userform. It will be easier to use that for someone to find a calculator, and will have additional options for inserting values into the active sheet. I've made the *current* buttons on the userform look exactly like the numberpad on my keyboard, without the pgup, home, del, etc, just the numbers and such. What I'd like to do is let people simply use the numberpad on their keyboard to "activate" the buttons on the userform, like 4, or + Wouldn't the keypress event of the form do it for you - can't check at the moment as the PC is tied up with a long macro job, but I would check that first! I tried an Application.OnKey "7","Command7_Click" in the userform initialisation, but that didn't work, it threw up an error. So I'm assuming that I can't link to a userform macro or something? I also tried to use the "Accelerator" field, but that only works when Alt is pressed down. And only works on the keyboard section, rather than the numberpad. So I have one 7 that works when I press shift, but one that doesn't. Is there a quick way to assign the numberpad keys (including numlock) to buttons on a userform? Since they're command buttons, it doesn't need to press the button as such, just trigger the "commandbutton_click" event. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Is there an easy Copy/Paste of a Userform ? (Entire Userform Including tx & cbx's) | Excel Programming | |||
Assign shortcut to button on userform | Excel Programming | |||
Looping procedure calls userform; how to exit loop (via userform button)? | Excel Programming | |||
KeyBindings like Word. | Excel Discussion (Misc queries) | |||
Keybindings Collection in Excel | Excel Programming |