Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- https://excel-egy.com/forum/t4314
- ---------------------------------
- 'KeyCode Table
- 'http://www.foreui.com/articles/Key_Code_Table.htm
- '-------------------------------------------------
- 'In Standard Module
- '------------------
- #If Win64 Then
- Private Declare PtrSafe Function Keyboard Lib "user32" Alias "LoadKeyboardLayoutA" (ByVal ss As String, ByVal sss As Long) As LongPtr
- #Else
- Private Declare Function Keyboard Lib "user32" Alias "LoadKeyboardLayoutA" (ByVal ss As String, ByVal sss As Long) As Long
- #End If
- Sub SetArabic()
- Call Keyboard("00000401", 1)
- End Sub
- Sub SetEnglish()
- Call Keyboard("00000409", 1)
- End Sub
- 'In UserForm Module
- '------------------
- Private Sub TextBox1_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, ByVal Shift As Integer)
- If KeyCode = 119 Then 'F8 = 119
- Call SetArabic
- ElseIf KeyCode = 116 Then 'F5 = 116
- Call SetEnglish
- End If
- End Sub
Add Comment
Please, Sign In to add comment