Home |
Search |
Today's Posts |
|
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
VBA method to detect state of CAPSLOCK key?
Declare Function GetKeyboardState Lib "user32" _
(pbKeyState As Byte) As Long Function CapsLock() As Boolean Dim Res As Long Dim KBState(0 To 255) As Byte Res = GetKeyboardState(KBState(0)) CapsLock = KBState(&H14) And 1 End Function Usage: Sub ShowCapsLockState() msgbox "Caps Lock on? " & capslock End Sub -- Regards, Tom Ogilvy "Jquads" wrote in message ... I'm not looking for code to turn CAPSLOCK on or off; I simply want to detect the state of the CAPSLOCK key. I'm running Excel10 and 11. TIA for any suggestions. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
replace state names with state code abbreviations | Excel Worksheet Functions | |||
Detect open-state of xls from outside Excel | Excel Discussion (Misc queries) | |||
toggle capslock when opening workbook | Excel Discussion (Misc queries) | |||
How can I show state-by-state data (as silos) on a map of NA | Charts and Charting in Excel | |||
Converting State Names to State Abbreviations | Excel Discussion (Misc queries) |