Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Key behaviour

Hi there,

Is there a possibilty to capture the keycode from a
worksheet. Not from a form or checkbox or related objets.
I would like to recognize from the worksheet when a <F4
is given to execute some code.

Many thanks in advance.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 103
Default Key behaviour

On Fri, 18 Jul 2003 01:21:44 -0700, "Rodney"
wrote:

Hi there,

Is there a possibilty to capture the keycode from a
worksheet. Not from a form or checkbox or related objets.
I would like to recognize from the worksheet when a <F4
is given to execute some code.

Many thanks in advance.


Just be aware that this will last for the length of your Excel
session, and will apply to ALL workbooks.

Sub GetKeyAndDoSomething()

'To make this line run automatically, put it in the
'Workbook_Open event in the Workbook's code module
'instead of a standard procedure like this one.

Application.OnKey "{F4}", "MyProcedure"

End Sub


Sub MyProcedure()

MsgBox "This is my procedure."

End Sub

---------------------------------------------------------
Hank Scorpio
scorpionet who hates spam is at iprimus.com.au (You know what to do.)
* Please keep all replies in this Newsgroup. Thanks! *
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
Weird VBA Behaviour msnyc07 Excel Worksheet Functions 13 February 15th 10 08:04 AM
Bizarre XLA behaviour [email protected][_2_] Excel Discussion (Misc queries) 4 March 11th 09 03:35 PM
Range-name Behaviour Peter Excel Discussion (Misc queries) 3 September 16th 08 10:06 PM
for...next funny behaviour Steve Excel Discussion (Misc queries) 4 June 30th 08 08:06 PM
Strange behaviour Edgar Thoemmes Excel Worksheet Functions 1 February 8th 05 03:20 PM


All times are GMT +1. The time now is 06:43 PM.

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"