Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
how can I trap the change event (Tab Press key) of these controls | Excel Worksheet Functions | |||
how can I trap the change event (Tab Press key) of these controls | Excel Worksheet Functions | |||
i have to press sent to email | Excel Programming | |||
key press event? | Excel Programming | |||
on press | Excel Programming |