Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Does a user form have an on open event and a keydown
event. if so how do i set them. i have the code. i just don't know how to trigger it. |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi
Yes. Rightclick it in the VB editor, choose View Code, to get to its module. There, choose "Userform" in the top left dropdown and KeyDown in the top right to generate the event code. "Initialize" runs on load and "Activate" on every show. However, a userform Keydown won't run if you type into a control like a textbox. You need that control's KeyDown event for that, there is no keypreview property to help. HTH. Best wishes Harald "FSt1" skrev i melding ... Does a user form have an on open event and a keydown event. if so how do i set them. i have the code. i just don't know how to trigger it. |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
thanks Harald
-----Original Message----- Hi Yes. Rightclick it in the VB editor, choose View Code, to get to its module. There, choose "Userform" in the top left dropdown and KeyDown in the top right to generate the event code. "Initialize" runs on load and "Activate" on every show. However, a userform Keydown won't run if you type into a control like a textbox. You need that control's KeyDown event for that, there is no keypreview property to help. HTH. Best wishes Harald "FSt1" skrev i melding ... Does a user form have an on open event and a keydown event. if so how do i set them. i have the code. i just don't know how to trigger it. . |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
KeyDown event on form | Excel Discussion (Misc queries) | |||
What code do I use to attach event handler that will open my user. | Excel Worksheet Functions | |||
User function and Open Event | Excel Programming | |||
KeyDown event in sheet | Excel Programming | |||
keydown event | Excel Programming |