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

How can I detect when a user presses Ctrl+Alt+G (or any similar key combination) while any worksheet is active? Thanks
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 88
Default Handle keyboard events

"Tatsujin" wrote in message
How can I detect when a user presses Ctrl+Alt+G (or any similar key
combination) while any worksheet is active? Thanks


If you only want to trap one or perhaps a handful of key combinations use
Application.OnKey

https://docs.microsoft.com/en-us/off...lication.onkey

Sub CtrlAltG(bInit As Boolean)
Application.OnKey "^%g", IIf(bInit, "TestCtrlAltG", "")
End Sub

Sub TestCtrlAltG()
MsgBox "TestCtrlAltG"
End Sub

Don't forget to clear any OnKeys when done, for example in the workoks close
event

For something more general purpose look into use of the GetAsyncKeyState
API, though Alt strokes probably won't pass through the sheet, so to speak.
Some examples from long ago!

https://groups.google.com/g/microsof...tAsyncKeyState

Peter T


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 a keyboard shortcut to fill handle a large # of cells? Erin Excel Discussion (Misc queries) 2 December 22nd 09 01:13 AM
What is keyboard shortcut equivalent to drag the fill handle JZ Excel Discussion (Misc queries) 2 July 31st 06 06:25 AM
Keyboard command to replace double clicking the fill handle Pat Excel Discussion (Misc queries) 1 May 18th 05 05:50 PM
How to handle all delete row events in excel Tom Hughes Excel Programming 0 October 22nd 04 07:24 PM
Office2003: Handle events for web charting component Sunil K Excel Programming 0 February 9th 04 02:26 PM


All times are GMT +1. The time now is 05:45 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"