====== VBA Taste gerückt erkennen (SHIFT) ======
https://msdn.microsoft.com/de-de/library/windows/desktop/dd375731%28v=vs.85%29.aspx
{{:windows:programming:vba:key_value.pdf|}}
In einem Modul:
Public Const SHIFT_KEY = &H10 'Shift
#If VBA7 Then
Declare PtrSafe Function GetKeyState Lib "USER32" (ByVal vKey As Long) As Integer
#Else
Declare Function GetKeyState Lib "USER32" (ByVal vKey As Long) As Integer
#End If
Und im Code kann man dann einfach prüfen, zBsp ob diue Shift-taste gedrückt ist.
If GetKeyState(SHIFT_KEY) < 0 Then MsgBox "Shift key is pressed"