Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 130
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 244
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Is there an easy Copy/Paste of a Userform ? (Entire Userform Including tx & cbx's) Corey Excel Programming 2 January 9th 07 01:01 PM
Assign shortcut to button on userform MarMo Excel Programming 2 October 24th 06 02:22 PM
Looping procedure calls userform; how to exit loop (via userform button)? KR Excel Programming 6 July 27th 05 12:57 PM
KeyBindings like Word. Moshe Excel Discussion (Misc queries) 1 February 9th 05 06:31 PM
Keybindings Collection in Excel John[_88_] Excel Programming 1 July 26th 04 06:03 PM


All times are GMT +1. The time now is 08:54 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"