Excel中如何判断按下了回车键
发布网友
发布时间:2022-04-24 22:56
我来回答
共2个回答
热心网友
时间:2023-10-14 01:34
按
tab
键
右移;按shift+tab向左移;按回车向下,按shift+回车向上移。
在excel里面点工具→选项→编辑→按enter向后移动这里还可以定义按下回车后移动方向。
热心网友
时间:2023-10-14 01:34
Declare Function GetKeyState Lib "user32.dll" (ByVal nVirtKey As Long) As Integer
Sub keycodes()
Dim x As Long
x = GetKeyState(&HD) ' Enter's virtual key code is &H0D
If (x And &H80) = &H80 Then ' check to see if it is toggled
Debug.Print "Enter is currently toggled."
End If
If (x And &H1) = &H1 Then ' check to see if it is depressed
Debug.Print "Enter is currently depressed."
End If
End Sub