Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default user form-on open event? keydown event?

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,327
Default user form-on open event? keydown event?

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 12
Default user form-on open event? keydown event?

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
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
KeyDown event on form Horatio J. Bilge, Jr. Excel Discussion (Misc queries) 0 October 26th 07 03:30 PM
What code do I use to attach event handler that will open my user. TeresaManley Excel Worksheet Functions 2 May 5th 07 09:55 PM
User function and Open Event Yuriy Excel Programming 2 July 7th 04 12:21 PM
KeyDown event in sheet Peter Wallin Excel Programming 1 February 27th 04 10:25 AM
keydown event jim c. Excel Programming 1 October 10th 03 03:16 AM


All times are GMT +1. The time now is 11:07 AM.

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

About Us

"It's about Microsoft Excel"