Customised OnKey with example
Download the attached example file. Goto the module 'mod_OnKey' and run the procedure named 'Testit'.
Alternatively, paste the following code in any module and call it from anywhere in the workbook to set application onkey.
Sub setAppOnkey(blnShiftKey As Boolean, blnCtrlKey As Boolean, blnAltKey As Boolean, strKey As String, strCallFunction As String, Optional blnSetNormal As Boolean)
Dim strShift As String
Dim strCtrl As String
Dim strAlt As String
strShift = ""
strCtrl = ""
strAlt = ""
If blnShiftKey Then strShift = "+"
If blnCtrlKey Then strCtrl = "^"
If blnAltKey Then strAlt = "%"
If blnSetNormal = True Then
Application.OnKey strShift & strCtrl & strAlt & "{" & strKey & "}"
Else
Application.OnKey strShift & strCtrl & strAlt & "{" & strKey & "}", strCallFunction
End If
End Sub
Attachment | Size |
---|---|
OnKey.xls | 24.5 KB |
- Vishesh's blog
- Login or register to post comments
- 14511 reads
Recent comments
5 years 41 weeks ago
6 years 27 weeks ago
6 years 39 weeks ago
6 years 42 weeks ago
6 years 43 weeks ago
6 years 48 weeks ago
7 years 4 weeks ago
7 years 5 weeks ago
7 years 5 weeks ago
7 years 5 weeks ago