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

Hey

I need to be able to have a msgbox pop up when the user hits CTRL +
SHIFT in a cell on an Excel worksheet.

Lets say the user selects cell A1. Then at anytime after A1 has been
selected and the user presses those keys, I need for it to trigger a
msgbox to pop up. Is this possible and if so, how would I do this?


Below is some code I found that works, but how do I make it work when
the user hits CTRL + SHIFT from an active cell?

'This code goes in the top of the module of your choice
Private Declare Function GetAsyncKeyState Lib "user32" _
(ByVal vKey As Long) As Integer

Private Const VK_CONTROL = &H11
Private Const VK_SHIFT = &H10

'Then this code goes in the event of your choice (same module as where
above code is)
If GetAsyncKeyState(VK_CONTROL) < 0 Then
If GetAsyncKeyState(VK_SHIFT) < 0 Then
MsgBox "Test"
End If
End If

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
how can I trap the change event (Tab Press key) of these controls Padam Excel Worksheet Functions 1 August 10th 06 03:59 PM
how can I trap the change event (Tab Press key) of these controls Padam Excel Worksheet Functions 0 August 10th 06 02:41 PM
i have to press sent to email Excel Ox Excel Programming 16 February 21st 06 06:52 PM
key press event? short_n_curly[_19_] Excel Programming 2 July 15th 05 08:43 PM
on press Fraggs[_18_] Excel Programming 1 June 7th 04 05:16 PM


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